All Posts

All the stuff I've written on this site

createPreviousMemo (SolidJS)
Get the previous value of a SolidJS signal
01/01/23
01/06/23
Cypress Stuff
Miscellaneous snippets for doing things in Cypress
11/30/22
01/12/23
PartiallyOptional
A TypeScript generic type to make part of another type optional
10/10/22
Inspect
A useful function to print out the value of something with an optional message
10/06/22
01/12/23
Tailwind CSS Hocus Plugin
A plugin for lazy people like me who use the same styles for hover and focus states
09/19/22
11/30/22
Stop Vercel GitHub Comments
Stop Vercel's bot from commenting on PRs and commits (and the associated emails)
08/27/22
10/13/22
useIsMouseInactive (SolidJS)
Know when the mouse hasn't moved for a period of time
08/27/22
03/18/23
useSyncedLocalStorage (React)
Save state to localStorage and sync it between hook instances, tabs and windows!
07/07/22
10/13/22
useCssVar (React)
Control a css variable from the comfort of React.
05/04/22
01/14/23
useCopy (React)
Copy to clipboard with a 'copied' timeout
05/02/22
10/13/22
useCopy (SolidJS)
Copy to clipboard with a 'copied' timeout
05/02/22
08/27/22
File Downloads
Download a file with or without JavaScript
04/26/22
10/13/22
Enzyme Stuff
Miscellaneous snippets for working if you have to do tests with Enzyme
02/20/22
11/30/22
PartiallyRequired
A TypeScript generic type to make part of another type required
10/28/21
10/10/22
cx
A tiny helper function to conditionally join classnames.
05/09/21
03/18/23
useBoolean (React)
Toggle and set a boolean piece of state with a slightly better interface than straight useState
05/02/21
03/18/23
Next.js <Redirect />
A <Redirect /> component like the one for react-router.
04/02/21
03/18/23
useMounted (React)
Know when the current component is mounted.
04/02/21
03/18/23
debounce
Run a function at most once every N seconds, at the end of the N seconds.
03/28/21
throttle
Run a function at most once every N seconds, at the start of the N seconds.
03/28/21
useLocalStorage (React)
Save state to localStorage with an interface almost identical to useState
03/26/21
03/18/23
Hello World
Show "Hello, World!" to your screen.
03/24/21
09/07/22
26 posts total