Skip to content

Instantly share code, notes, and snippets.

View josephdburdick's full-sized avatar
😇
Mentally present

Joe josephdburdick

😇
Mentally present
View GitHub Profile
@t3dotgg
t3dotgg / try-catch.ts
Last active April 9, 2025 13:40
Theo's preferred way of handling try/catch in TypeScript
// Types for the result object with discriminated union
type Success<T> = {
data: T;
error: null;
};
type Failure<E> = {
data: null;
error: E;
};
@yifanzz
yifanzz / code-editor-rules.md
Created December 17, 2024 00:01
EP12 - The One File to Rule Them All

[Project Name]

Every time you choose to apply a rule(s), explicitly state the rule(s) in the output. You can abbreviate the rule description to a single word or phrase.

Project Context

[Brief description ]

  • [more description]
  • [more description]
  • [more description]
@GitTom
GitTom / #Supabase-Import-Auth-Users.md
Last active February 20, 2025 11:35
Supabase Import Auth Users (from an import table into auth.users and auth.identities)

Create new Supabase Auth Users

With the new users loaded from 'import.users' table.

2024-10 Started from ...
https://gist.github.com/khattaksd/4e8f4c89f4e928a2ecaad56d4a17ecd1
With addition of 'provider_id' as per @fluid-design-io
With my additions to load import data from import.users table,
to save generated values back into that table, and
to be able to add rows when destination tables are not empty.

@alexanderson1993
alexanderson1993 / AlertDialogProvider.tsx
Created April 2, 2023 19:07
A multi-purpose alert/confirm/prompt replacement built with shadcn/ui AlertDialog components.
"use client";
import * as React from "react";
import { Input } from "@/components/ui/Input";
import { Button } from "@/components/ui/Button";
import {
AlertDialog,
AlertDialogContent,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogDescription,
@ultrox
ultrox / resetFieldset.css
Created March 6, 2020 11:30 — forked from nicolasrenon/resetFieldset.css
Reset fieldset and legend styles
/* From http://thatemil.com/blog/2015/01/03/reset-your-fieldset/ by Emil Björklund */
legend {
display: table;
padding: 0;
}
fieldset {
border: 0;
margin: 0;
min-width: 0;
@mixin lhCrop($line-height) {
&::before {
content: '';
display: block;
height: 0;
width: 0;
margin-top: calc((1 - #{$line-height}) * 0.5em);
}
}
@souporserious
souporserious / getJSONFromFigmaFile.js
Created July 13, 2018 21:52
Generates JSON from Figma file
import request from 'request'
const api_endpoint = 'https://api.figma.com/v1'
const personal_access_token = 'FIGMA_ACCESS_TOKEN_HERE' // https://www.figma.com/developers/docs#auth-dev-token
function downloadSvgFromAWS(url) {
return new Promise((resolve, reject) => {
request.get(
url,
{
@fbn4sc
fbn4sc / command.txt
Created January 29, 2018 01:35
Delete all branches except master and develop.
git branch | grep -v "master\|develop" | xargs git branch -D
"use strict"
const express = require('express')
const graphqlHTTP = require('express-graphql')
const { parse, print, visit, parseValue, printSchema, buildSchema } = require('graphql')
const app = express()
const util = require('util')
const graphqlTools = require('graphql-tools');
const rawSchema =`
const spacingFactor = 8;
export const spacing = {
space0: `${computeGoldenRatio(spacingFactor, 0)}px`, // 8
space1: `${computeGoldenRatio(spacingFactor, 1)}px`, // 13
space2: `${computeGoldenRatio(spacingFactor, 2)}px`, // 21
space3: `${computeGoldenRatio(spacingFactor, 3)}px`, // 34
space4: `${computeGoldenRatio(spacingFactor, 4)}px`, // 55
space5: `${computeGoldenRatio(spacingFactor, 5)}px`, // 89
};