Code Snippets
If I feel that a bite-sized snippet can be useful to someone else, I jot it down. Feel free to use them in your projects, and contact me if something is wrong.
Playing a sound with the Web Audio API
A React hook to play a sound when a timer ends
TypeScriptReactWeb Audio API
Authorization module in Elixir
A naive authorization module that works for me at the moment
ElixirAuthorization
Auto-hide Phoenix flash messages
Enhancing the core Flash component with a simple JavaScript hook
ElixirPhoenixJavaScript
Using Basic Auth middleware with Next.js
Simple, drop-in middleware for adding basic auth to your Next.js app
Next.jsTypeScriptMiddleware
Using Basic Auth with Remix
No need to pay for a simple password-protected website, use the platform
RemixReactAuthentication
Generating a base64 blurred placeholder image
The utility I use for my placeholder images
TypeScriptImage Processing
Domain Model with Zod & FP-TS
Simple domain model with Zod and FP-TS for a User entity
FP-TSTypeScript
Rate Limiter Service in Elixir
Custom rate limiter service using ETS and GenServer
ElixirRate-limiterETSGen-server
useObservable
A simple TypeScript hook for subscribing to a BehaviorSubject with React Hooks
ReactReact Hooks
usePrevious
The utility I use to get the previous value of a prop
ReactReact Hooks