Skeleton screens for better perceived performance

Skeleton screens show content placeholders while data loads, making apps feel faster than spinners. I create skeleton components that match the layout of actual content with subtle pulsing animations. React Query's isLoading flag determines whether to

PostgreSQL JSONB for flexible schema design

PostgreSQL JSONB stores binary JSON efficiently with indexing support. I use JSONB for semi-structured data, dynamic attributes, event logs. JSONB operators enable querying nested data—->, ->>, @>, ?. GIN indexes accelerate JSONB queries.

React Query optimistic update for likes

Interactive UI should feel instant even when the network isn’t. With optimistic updates, I update the cache immediately and roll back if the server rejects the mutation. The trick is to keep optimistic state small and obvious: update a count and a boo

Pattern matching with match for exhaustive case handling

Rust's match expression is like a switch statement on steroids. It requires exhaustive handling of all cases, and the compiler enforces this. You can match on enums, tuples, references, ranges, and destructure nested data. Guards (if condition) add ex

Background job scheduling with sidekiq-scheduler

Recurring tasks like cleanup jobs, report generation, or cache warming need reliable scheduling. The sidekiq-scheduler gem extends Sidekiq with cron-like scheduling without requiring separate infrastructure like cron or Kubernetes CronJobs. I define s

Multi-step wizard navigation with Turbo Frames

Wizards are often over-engineered with client state machines. With Turbo Frames, I render each step inside a frame, and the “Next” button simply POSTs to update the record and then redirects to the next step URL. If validation fails, I re-render the s

Haptic feedback with UIFeedbackGenerator

Haptic feedback provides tactile responses that enhance user experience. iOS offers three feedback generators: UIImpactFeedbackGenerator for physical impacts with light, medium, or heavy intensities; UINotificationFeedbackGenerator for success, warnin

Custom Turbo Stream action: reset a form after success

After a successful inline create, I usually want to clear the form. You can replace the whole form partial, but sometimes you want to preserve other state (like which field was focused) and simply reset values. A clean Hotwire approach is a custom Tur

Rate limiting by IP + user (Express)

A single abusive client can ruin your latency budget for everyone else, so I rate limit early rather than trying to ‘detect abuse’ after the outage starts. I combine an IP bucket with a user bucket: IP protects unauthenticated endpoints, user protects

Django model soft delete pattern

Soft deletes mark records as deleted without removing them from the database. I add a deleted_at field and override the delete() method. A custom manager excludes soft-deleted records by default. I provide a hard_delete() method for permanent removal.

Request timeout handling with Rack::Timeout

Long-running requests tie up worker threads and degrade overall application responsiveness. Rack::Timeout enforces request timeouts at the Rack layer, killing requests that exceed configured limits. I set conservative timeouts (15-30 seconds) and hand

cargo-expand to inspect macro expansions

cargo expand is a subcommand that shows the output of macro expansion. It's invaluable for debugging derive macros, understanding what declarative macros produce, or learning how async functions desugar. I run cargo expand --lib to see the entire crat