Things I've written down.
Ruby, Rails, performance, security and applied machine learning. Updated when something feels finished.
Blocking 99.3% of spoofing attacks with nothing but a webcam
No infrared, no depth sensor, no GPU. What a multi-signal liveness pipeline actually catches, what it misses, and the cheapest check that beat all the expensive ones.
Temperature is not a creativity dial
Temperature, top-k and top-p are three different operations on one probability distribution. Treat them as vibes and you'll tune the wrong one. Watch them act on a model small enough to see.
Real SQLite in the browser, from a Rails app
Running WebAssembly from a strict Rails app touches three things people rarely think about together: your Content Security Policy, your MIME types, and whether the bytes you vendored are the bytes you meant.
Your RAG demo is lying to you
Every shortcut you take to make retrieval cheap — a smaller model, an approximation, a reduced dimension — can invent failures the real system doesn't have. Check the behaviour you're about to teach or ship.
Judge the result, not the keystrokes
Most interactive tutorials check whether you typed the expected command. That teaches imitation. Comparing the state you produced against a goal teaches the thing itself — and it changes how you build the simulator.
pgvector or a dedicated vector database?
For most applications the answer is the database you already run, and the threshold where that stops being true is higher than the marketing suggests.
The callback that fires in a test you didn't write
Active Record callbacks are convenient until a fixture, a seed script or a bulk import triggers side effects nobody expected.
Indexes that earn their keep
Adding an index is the reflex fix for a slow query. Column order, cardinality and write cost decide whether it does anything at all.
A CSP that actually stops XSS
Most content security policies are decorative. The directive that matters is script-src, and 'unsafe-inline' undoes the whole thing.
Fat models, skinny controllers, and the third option
Both halves of the old advice produce the same result at scale: one enormous class. Naming the operation is what actually helps.