Rails Flash messages for user feedback

Flash messages provide one-time notifications across requests, perfect for confirming actions or showing errors. I use flash[:notice] for success messages and flash[:alert] for errors. Flash persists in session storage for one request, then auto-delet

wasm-bindgen for Rust to JavaScript interop in WebAssembly

Wasm-bindgen generates JavaScript bindings for Rust code compiled to WebAssembly. Annotate functions with #[wasm_bindgen], and the tool generates JS glue code. I use it to write performance-critical browser code in Rust: parsers, crypto, data processi

Actuator for production monitoring

Spring Boot Actuator provides production-ready features—health checks, metrics, info endpoints. /actuator/health shows application status for load balancers. /actuator/metrics exposes JVM metrics, HTTP stats, custom metrics. /actuator/info displays ap

Tabs UI using Turbo Frames (no client router)

Tabs often turn into a mini-SPA. Instead, I treat each tab as a URL and load its content into a turbo_frame_tag named tab_content. Clicking a tab link targets that frame. This gives you browser history, deep linking, and sharable URLs, while keeping t

Django REST Framework throttling for rate limiting

Throttling prevents API abuse by limiting request rates. DRF provides AnonRateThrottle for anonymous users and UserRateThrottle for authenticated users. I configure rates in settings like 'user': '100/hour'. For custom logic, I subclass BaseThrottle a

Declarative model broadcasts with broadcasts_to (Rails 7)

When I’m on Rails 7+, I like broadcasts_to because it makes realtime behavior obvious in the model. Instead of writing explicit after_create_commit hooks, I declare that a model broadcasts to its parent or to a scope. Then Turbo uses conventional part

Bounded worker pool with backpressure

I avoid unbounded goroutines when processing queues; they look fine in staging and then blow up under a burst. This worker pool keeps a fixed number of workers and a bounded channel for jobs, which creates backpressure by design. The Submit call respe

API versioning with namespace routing

API versioning is critical for maintaining backward compatibility while evolving your endpoints. I use Rails namespace routing to organize versions cleanly within the app/controllers structure. Each version lives in its own module like Api::V1 or Api:

Stimulus: autofocus the first invalid field after Turbo update

Turbo stream re-renders can drop focus, which is rough for accessibility. Use turbo:render to focus the first invalid field inside a specific container. This feels “native” and reduces user friction.

Database maintenance with VACUUM and ANALYZE

VACUUM reclaims storage from dead tuples. Updates and deletes leave dead rows—VACUUM removes them. Autovacuum runs automatically but needs tuning. VACUUM FULL rewrites entire table—requires lock, reclaims most space. Understanding bloat prevents perfo

Turbo Streams fallback to HTML for older clients

Even in a Hotwire-first app, I keep HTML fallbacks because it makes features robust and keeps endpoints usable for bots and scripts. In controllers, I almost always include format.html alongside format.turbo_stream. For example, on create I return tur

Unsafe Rust for FFI and low-level optimizations

Unsafe Rust lets you bypass some of the compiler's safety checks when necessary. Common uses include FFI (calling C code), dereferencing raw pointers, and implementing low-level data structures. The unsafe keyword creates a boundary where you promise