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.
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.
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.
Your average response time is lying to you
The mean hides the requests that make people leave. Percentiles, and the arithmetic of how often a user meets your worst case.
Exceptions that tell you what to do
Rescuing broadly turns a specific failure into a mystery. The useful distinction is between what you expected and what you didn't.