Skip to content

Instantly share code, notes, and snippets.

View jerriclynsjohn's full-sized avatar

Jerric Lyns John jerriclynsjohn

View GitHub Profile
@jerriclynsjohn
jerriclynsjohn / timescaledb-quickstart-node-prisma.md
Created July 4, 2024 08:19
Quick Start: Node, Prisma and TimescaleDB

Quick Start: Node, Prisma and TimescaleDB

Goal

This quick start guide is designed to get the Node.js developer up and running with TimescaleDB as their database.

Pre-requisites

To complete this tutorial, you will need a cursory knowledge of the Structured Query Language (SQL). The tutorial will walk you through each SQL command, but it will be

@jerriclynsjohn
jerriclynsjohn / cuid.js
Created August 14, 2023 12:20 — forked from ericelliott/cuid.js
CUID - A Better Browser-side UID (Intentionally not GUID compliant)
/**
* cuid.js
* Collision-resistant UID generator for browsers and node.
* Sequential for fast db lookups and recency sorting.
* Safe for element IDs and server-side lookups.
*
* Extracted from CLCTR
*
* Copyright (c) Eric Elliott 2012
* MIT License
@jerriclynsjohn
jerriclynsjohn / toCase.js
Created October 14, 2019 01:01 — forked from trenskow/toCase.js
An convenience method for converting to and from different casing types.
if (!String.prototype.toCase) {
Object.defineProperties(String.prototype, {
'toCase': {
value: function(type = 'camel') {
const seperators = {
'camel': '',
'pascal': '',
'snake': '_',
'domain': '.',
@jerriclynsjohn
jerriclynsjohn / tailwind.md
Created September 2, 2019 05:45 — forked from sandren/tailwind.md
Tailwind CSS best practices

Tailwind CSS best practices

Utility classes

  1. When writing a string of multiple utility classes, always do so in an order with meaning. The "Concentric CSS" approach works well with utility classes (i.e,. 1. positioning/visibility 2. box model 3. borders 4. backgrounds 5. typography 6. other visual adjustments). Once you establish a familiar pattern of ordering, parsing through long strings of utility classes will become much, much faster so a little more effort up front goes a long way!

  2. Always use fewer utility classes when possible. For example, use mx-2 instead of ml-2 mr-2 and don't be afraid to use the simpler p-4 lg:pt-8 instead of the longer, more complicated pt-4 lg:pt-8 pr-4 pb-4 pl-4.

  3. Prefix all utility classes that will only apply at a certain breakpoint with that breakpoint's prefix. For example, use block lg:flex lg:flex-col lg:justify-center instead of block lg:flex flex-col justify-center to make it very clear that the flexbox utilities are only applicable at the