Skip to content

Instantly share code, notes, and snippets.

View joeyfigaro's full-sized avatar
🦀
Becoming a Rustacean

Jay Figaro joeyfigaro

🦀
Becoming a Rustacean
View GitHub Profile
import React from "react";
import { Link } from "react-router-dom";
export function createResource(getPromise) {
let cache = {};
let inflight = {};
let errors = {};
function load(key) {
inflight[key] = getPromise(key)
import React from "react";
import { Link } from "react-router-dom";
export function createResource(getPromise) {
let cache = {};
let inflight = {};
let errors = {};
function load(key) {
inflight[key] = getPromise(key)
@joeyfigaro
joeyfigaro / PaginationCalculator.ts
Created July 18, 2024 19:33 — forked from jimjam88/PaginationCalculator.ts
TypeScript Pagination Values Calculator
import range from "lodash.range";
type PageRangeArgs = {
size?: number,
last: number,
current: number,
}
type PageRangeReturnValue = number[];
@joeyfigaro
joeyfigaro / 194286737.json
Last active September 1, 2023 14:57
Release flags for projects
{
"source": "toggl",
"enabled": false
}
@joeyfigaro
joeyfigaro / rainbow.py
Last active November 17, 2022 15:12
Kids Python Learning
from turtle import*
pensize(15)
penup()
goto(50,70)
left(90)
@joeyfigaro
joeyfigaro / favorites.json
Created April 5, 2022 21:23
gitstumble-settings
[]
@joeyfigaro
joeyfigaro / theme.ts
Created January 6, 2022 21:38
Stitches Debugging
import { createStitches } from '@stitches/react'
export const {
theme,
styled,
css,
config,
globalCss,
createTheme,
keyframes,
@joeyfigaro
joeyfigaro / aws-osx-resolution.md
Created April 16, 2021 13:35
Fix display resolution on AWS mac1.metal machines

Install displayplacer

brew tap jakehilborn/jakehilborn && brew install displayplacer

Grab persistent screen id and desired resolution from output:

displayplacer list

Use screen id and resolution from previous step

displayplacer "id:<persistentScreenID> res:<resolution> origin:(0,0) degree:0"

@joeyfigaro
joeyfigaro / find-with-filtering.md
Created April 6, 2021 14:19
['find' with path filtering] Find target files while ecluding a set of specified directories #osx #find #monorepos #commandline
find / -name MyFile ! -path '*/Directory/*'

Example

Find all package.json files in monorepo packages (excluding node_modules/* and specific package location)

find . -name 'package.json' ! -path '*/node_modules/*' ! -path '*/prisma/generated/*'