Concurrent counter increments are a race-condition trap. The Rails idiom (load the record, increment in Ruby, save) breaks under...
Getting parseable output back from an LLM has two halves: shaping the request, then parsing the response. Even with Ollama...
A page scanned upside down or sideways has the potential to confuse OCR engines and vision LLMs. While both are...
When an LLM is part of a request, you want to keep track of how much of the runtime was...
When an LLM model has vision capabilities, you can attach Base64-encoded images to chat messages, and it will load...
By default, Ollama produces non-deterministic output: The same prompt will yield slightly different results each time. To get reproducible...
I recently ran into this issue when processing a massive backlog of documents. The server completely stalled, sometimes taking up...
When working with file uploads, we sometimes need to process intrinsic properties like the page count or page dimensions of...
In rare circumstances, you want to use a websites full domain (say https://mywebsite.com) while testing in dev mode. This...
If your rubocop run fails with a stack like rubocop-1.61.0/lib/rubocop/server/socket_reader.rb:36:in `ensure in read!': undefined method `string...
Short reference on how to quickly debug the vanilla Rails job adapters. Queue Adapters by Environment Environment Adapter
Sometimes you have a maintenance script where you want to iterate over all ActiveRecord models. Rails provides this out of...
When your Rails application is using Redis as its cache store, this is how you can list existing keys:
Enable local logging for Sentry when: Debugging Sentry event capture locally Testing error handling without polluting production metrics Developing background...
Rails log files rotate automatically when they reach approx. 100MB: $ ls -lh log/ -rw-r--r-- 1 user group 55M...
When RSpecs runs the first feature spec, you may see log output like this: Capybara starting Puma... * Version 6.5.0, codename...
In Rails 7.2 the new default for config.action_dispatch.show_exceptions is rescuable. :rescuable: It will show a Rails error page in...
Frontend performance and user experience are orthogonal to feature development. If care is not taken, adding features usually degrades frontend...
We usually ship applications that self-host webfonts to comply with GDPR. Many popular web fonts are available as NPM...
Even if you don't make any beginner mistakes like N+1 queries or missing DB indices, some requests can...
Why Rails has multiple schema formats When you run migrations, Rails will write your current database schema into db/schema.rb. This...
ActiveStorage does not provide any built-in way of implementing authentication for the available DirectUpload endpoint in Rails. When using...
Given there is a user with an attachable avatar: class User < ApplicationRecord has_one_attached :avatar end
Here is a bash script that I use to auto-configure displays on Ubuntu 24.04 with Xorg. Background