All Posts

All the stuff I've written on this site

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
10/24/22
Tailwind CSS Hocus Plugin
A plugin for lazy people like me who use the same styles for hover and focus states
09/19/22
09/22/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
09/03/22
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
10/13/22
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
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
09/03/22
useBoolean (React)
Toggle and set a boolean piece of state with a slightly better interface than straight useState
05/02/21
09/14/22
Next.js <Redirect />
A <Redirect /> component like the one for react-router.
04/02/21
09/03/22
useMounted (React)
Know when the current component is mounted.
04/02/21
09/14/22
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
10/13/22
Hello World
Show "Hello, World!" to your screen.
03/24/21
09/07/22
23 posts total