Skip to content

Instantly share code, notes, and snippets.

View josephdburdick's full-sized avatar
😇
Mentally present

Joe josephdburdick

😇
Mentally present
View GitHub Profile
@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
};
import React from 'react';
import { getDataFromTree } from 'react-apollo/lib/index';
class AsyncRoute extends React.Component {
constructor(props) {
super(props);
this.state = {
route: props.children
};
}
@estrattonbailey
estrattonbailey / react-shortcodes.js
Last active June 5, 2024 15:58
React Shortcodes
import React from 'react'
import { renderToString } from 'react-dom/server'
import parser from './shortcode-parser'
export const add = parser.add
const Aside = ({ children, config }) => {
/**
* config = {
* foo: true,
@jaredatch
jaredatch / functions.php
Last active February 28, 2022 22:04
WordPress Search Autocomplete using WP REST API v2
<?php
/**
* Enqueue scripts and styles.
*
* @since 1.0.0
*/
function ja_global_enqueues() {
wp_enqueue_style(
'jquery-auto-complete',