Skip to content

Instantly share code, notes, and snippets.

import * as React from 'react'
import { SpringValue, easings, useSpring } from 'react-spring'
/**
* Hook that animates height when args.animationKey changes
*
* Ex:
* const animatedBlock = useAnimatedHeight({
* animationKey: key,
* })
@aaronsnoswell
aaronsnoswell / common-syllables.txt
Created February 5, 2022 12:59
The 322 most common syllables (ordered most common to least) in the 5000 most common English words
ing
er
a
ly
ed
i
es
re
tion
in
@reconbot
reconbot / batchFetchExchange.ts
Last active February 13, 2024 11:19
A batching exchange for URQL that lets you opt out of batch queries adapted form @jakubriedl's POC This version works on non persisted queries.
// Adapted from https://gist.github.com/jakubriedl/812c2a7b26927a2249a4719555d9a0ca
import DataLoader from 'dataloader'
import { Exchange, Operation } from 'urql'
import { pipe, map } from 'wonka'
interface BatchRequest {
url: RequestInfo | string
options?: RequestInit
}
@juanbrujo
juanbrujo / PlayStationBIOSFilesNAEUJP.md
Last active May 5, 2024 04:08
Files for PlayStation BIOS Files NA-EU-JP
import * as React from "react";
import { useMousePosition } from "~/hooks/useMousePosition";
/** Component to cover the area between the mouse cursor and the sub-menu, to allow moving cursor to lower parts of sub-menu without the sub-menu disappearing. */
export function MouseSafeArea(props: { parentRef: React.RefObject<HTMLDivElement> }) {
const { x = 0, y = 0, height: h = 0, width: w = 0 } = props.parentRef.current?.getBoundingClientRect() || {};
const [mouseX, mouseY] = useMousePosition();
const positions = { x, y, h, w, mouseX, mouseY };
return (
<div
@ersinakinci
ersinakinci / globalFetchingExchange.js
Last active February 9, 2022 23:08
urql exchange for monitoring global fetching status
/* A naively-implemented urql exchange for monitoring whether urql is fetching
* a query or a mutation on a global level.
*
* https://formidable.com/open-source/urql/docs/concepts/exchanges
* https://wonka.kitten.sh
* https://wonka.kitten.sh/api/operators#onpush
*
* Example usage:
*
* // If this number is greater than 0, an operation is in-flight and so urql is fetching
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active April 7, 2024 22:55
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

Minimum Viable Async with Node 6

With the release of Node 6.0.0, the surface of code that needs transpilation to use ES6 features has been reduced very dramatically.

This is what my current workflow looks like to set up a minimalistic and fast microservice using micro and async + await.

The promise

@mbajur
mbajur / .md
Created April 29, 2016 07:16
How to create small, unique tokens in Ruby

How to create small, unique tokens in Ruby

That is is basically a "fork" of blog article i'm constantly returning to. It seems that the blog is down:

My choice: Dave Bass’s rand().to_s() trick

Dave Bass proposed this which I picked up for my implementation (here for an 8-chars token):