Code Snippets
Reusable code patterns I reference often
typescript
Debounce Function
A reusable debounce utility to limit function execution rate
utility performance events
typescript
Deep Clone Object
Create a true deep copy of nested objects and arrays
utility objects clone
python
Retry Decorator with Exponential Backoff
Automatically retry failed operations with increasing delays
decorator error-handling api
sql
SQL Upsert (Insert or Update)
Insert a row or update if it exists - PostgreSQL, MySQL, SQLite
database postgresql mysql
bash
Safe Bash Script Template
Bash script template with error handling and best practices
shell devops template
css
Smooth Scroll with CSS and JS
Implement smooth scrolling for anchor links and scroll-to-top
animation ux accessibility
typescript
useLocalStorage React Hook
Persist React state to localStorage with automatic serialization
react hooks storage
typescript
Throttle Function
Limit function execution to at most once per time period
utility performance events