How to auto-rotate images before OCR or computer vision tasks
Rotate scanned pages to upright before OCR or vision LLM processing; Tesseract OSD with sector probing improves orientation detection when pages are sideways, upside down, or noisy.
Tracking External API Performance in Rails Logs
Track time, call counts, and token usage for slow external APIs in Rails logs and Server Timing, making LLM regressions and prompt bloat visible without a debugger.
Faking and testing the network with WebMock
Network-dependent tests can avoid real HTTP by stubbing remote responses and asserting requests with WebMock, including query strings and bodies for GET and POST.
Handling NULL values in SQL comparison logic
NULL values break ordinary equality and negation checks in SQL, so rows can disappear unless queries handle unknowns explicitly with IS NULL, IS DISTINCT FROM, or COALESCE.
Optimizing images for LLM inference
Reducing image size and trimming whitespace lowers vision-token cost while keeping text readable; OCR-based strip slicing can keep dense pages within context limits.
Ollama: Strip image data from VCR recorded requests
VCR cassettes can bloat with base64-encoded vision payloads and leaked Basic Auth credentials; sanitizing request bodies and custom matching keep recordings small and playback reliable.
Ollama: How to generate deterministic results
Ollama output varies between runs by default; reproducible results require temperature: 0 and a fixed seed in request options.
Controlling issue grouping in Sentry
Sentry groups similar error events into one issue, and custom fingerprints or merge rules can combine timeouts and other recurring failures across code paths.
RSpec: automatic creation of VCR cassettes
RSpec examples tagged :vcr automatically record and replay HTTP cassettes, while untagged specs block network calls unless HTTP access is explicitly enabled.
Keeping web applications fast
Fast web apps avoid unnecessary database work, oversized assets, and heavy client-side rendering, while measuring bottlenecks before optimizing caches, scripts, images, or page delivery.
Apache Tika: Performance-optimized configuration for hybrid PDFs (Text + OCR)
Hybrid PDFs can trigger duplicate text and very slow OCR in Apache Tika when page images and layout fragments are processed indiscriminately. A size threshold keeps OCR focused on real content while preserving digital text extraction.
Small helper to conditionally re-record VCR cassettes
Conditional VCR cassette re-recording for RSpec specs avoids manual YAML deletion while iterating on failing tests.
Rails: Reporting CSP Violations to a log file
Capture CSP violation reports in a log file to spot blocked resources and browser-extension noise, with a dedicated Rails endpoint for incoming reports.
Rails: Destroying vs Deleting
Rails record removal differs in object instantiation, callbacks, and relation cache state; destroy honors dependent associations, while delete and delete_all skip them.
Jasmine: using async/await to write asynchronous specs
Readable Jasmine specs can use async/await for promises, async setup, event waiting, and controllable async spies instead of done callbacks.
Project management best practices: User stories & Issues
Clear, well-scoped issues reduce misunderstandings and rework in Linear. User stories, acceptance criteria, backlog priority, and rough estimates keep work actionable.
PSA: Chrome and Firefox do not always clear session cookies on exit
Chrome and Firefox can retain session cookies on exit when reopening tabs from the last session, so browser shutdown does not always end cookie lifetime.
ActiveRecord: count vs size vs length on associations
size is usually the right way to count associated records in Rails; count can ignore loaded children, while length loads everything.
nvm: Setting a default Node.js version
Set a persistent default Node.js version for new shells with nvm alias default, including an LTS release.
Toggling a maintenance page with Capistrano
Capistrano can switch an app into maintenance mode by publishing a static page on each web server, with customizable message, timing, and template.
How to get notified when Claude Code needs your input
Desktop notifications for Claude Code prevent missed prompts when the agent pauses for input; clicking the alert can reopen the project in your IDE.
Rails: Including HTML in your i18n locales
Rails t automatically marks _html translations as HTML-safe, allowing intentional links and formatting while still escaping unsafe interpolations.
8 steps for fixing other people's code
Making fixes in someone else’s GitHub repository is easier with modern open source tools, but pull requests and branch workflow still need care.
CSP: Nonces are propagated to imports
Module scripts with a nonce automatically pass that trust to dynamic import(), enabling chunk loading under restrictive CSP without strict-dynamic.