Things I've written down.
Ruby, Rails, performance, security and applied machine learning. Updated when something feels finished.
Migrations that don't take the site down
The dangerous migrations aren't the slow ones. They're the ones that take a lock while old and new code are both running.
One statement instead of ten thousand
Saving records in a loop is the slowest correct way to write data. The alternatives are faster and quietly skip things you may be relying on.
Counting on read is a bug you ship on purpose
A count in a loop is the N+1 nobody spots, because each query is fast and the logs look fine.
Accepting files from strangers
An upload endpoint accepts arbitrary bytes chosen by someone you don't know. Almost every mistake here comes from trusting what they say it is.
Interactive without a single-page app
Turbo gets you most of what a client-side framework does, with the state still on the server where it is easier to reason about.
Feature flags you can build in an afternoon
The value is decoupling deploy from release. That does not require a platform, and the platform is not the hard part.
Ruby pattern matching, in code you'd actually ship
It is not a switch statement. It destructures and validates shape in one expression, which is exactly what parsing external data needs.
Your RAG chatbot doesn't have a model problem
It has a measurement problem. Why swapping the model is the last thing to try, what to instrument first, and how an aggregate score hides the failure that matters.
The garbage you never had to create
Ruby's collector is fast. The cheapest object is still the one you didn't allocate, and in hot paths that difference is measurable.