AWS Lambda serverless functions with Terraform

Deploy serverless functions on AWS Lambda using Terraform. Configure API Gateway integration, CloudWatch logging, environment variables, and IAM roles. Package Python or Node.js handlers with dependencies, set up event triggers, and manage function ve

Expose build metadata for debugging deploys

When you’re on call, you eventually ask: “what version is running?” I expose a tiny /version endpoint that returns build metadata derived from debug.ReadBuildInfo plus a few variables set at build time. The goal isn’t perfect SBOMs; it’s fast debuggin

Stored procedures and functions in PostgreSQL

Stored procedures encapsulate business logic in database. Functions return values; procedures don't (PostgreSQL 11+). I use functions for reusable calculations, data transformations. PL/pgSQL provides procedural language—variables, loops, conditionals

System test: asserting Turbo Stream responses

I don’t test Hotwire behavior by guessing; I add system tests that exercise the UI. With Capybara, I click a button that triggers a Turbo Stream response and assert that the DOM changes without a full page reload. The exact assertion depends on the fe

Value objects for domain modeling

Value objects represent immutable domain concepts without identity. I use value objects for money, addresses, date ranges, coordinates. Value objects are compared by value, not identity—two identical addresses are equal. They're immutable—create new i

ActiveRecord scopes for reusable query logic

Scopes encapsulate reusable query logic directly in the model, improving code readability and reducing duplication across controllers and services. I use scopes for common filters like active, published, or recent rather than writing raw where clauses

JWT issuance and verification without common footguns

JWTs are easy to misuse because libraries make them look simpler than they are. I pin the algorithm, validate issuer and audience, keep expirations short, and rotate signing keys deliberately. I also avoid putting sensitive business data into tokens j

HMAC signed API requests for webhook and partner integrity

When I need lightweight message integrity without standing up a full asymmetric trust model, HMAC signing is a solid tool. The important details are canonicalization, timestamp freshness, and constant-time comparison. Most failed implementations get t

Python security audit script for exposed risky filesystem state

I like lightweight audit scripts that reveal obvious host hygiene problems quickly: world-writable files, suspicious SUID bits, and weak key permissions. These scripts are not a substitute for configuration management, but they help surface drift befo

Exponential backoff with jitter for retries

Immediate retries are a great way to stampede a struggling dependency. I use exponential backoff with jitter so retries spread out naturally and don’t synchronize across instances, and I cap the maximum delay so worst-case latency doesn’t become unbou

ETags for conditional requests and caching

ETags enable efficient caching by allowing clients to make conditional requests that return 304 Not Modified when content hasn't changed. Rails automatically generates ETags based on response content, and fresh_when or stale? methods handle the condit

Turbo Frames: infinite scroll with lazy-loading frame

Infinite scroll can be done with plain HTML + Turbo Frames. Render a “next page” frame with loading: :lazy so Turbo fetches it when it enters the viewport. No JS required, and it degrades gracefully.