developer.mozilla.org

Here is a workaround for when you want to use text-wrap: balance but must also render nicely for browsers...

ActiveStorage does not provide any built-in way of implementing authentication for the available DirectUpload endpoint in Rails. When using...

PostgreSQL can cosplay as a full-text search engine. It doesn't have the features or fidelity of ElasticSearch or...

There are several ways to run a single spec. I usually copy the spec file path with the line number...

The key to unlocking the full potential of LLMs in coding lies in crafting precise prompts. The main challenge is...

Here is a bash script that I use to auto-configure displays on Ubuntu 24.04 with Xorg. Background

Using ffmpeg, you can easily re-encode a video to reduce its file size. Command Do it like this:

In Slack, the settings dialog only offers a fixed selection of fonts. You can use any font you like using...

makandra dev
impactahead.com

Also see the list of IRB commands. Switching the context Changes the "default receiver" of expressions. Can be used to...

Your package-lock.json should always match and resolve all packages from your package.json. Coming from Yarn, I was looking for an...

In development, we store files using ActiveStorage's disk service. This means that stored files are served by your Rails...

tl;dr When a cookie includes an Expires attribute or an HTTP response includes caching headers like Expires or Cache...

When Ruby objects are inspected in any modern IRB, some objects (like ActiveRecord instances) are rendered with neat colors and...

makandra dev

Capistrano 3 has a doctor task that will print information about Environment: Ruby, Rubygems and Bundler versions List of Capistrano...

makandra dev

YJIT is Ruby's default just-in-time compiler. It is considered production-ready since Ruby 3.2 (source).

github.com

Zeitwerk is the new autoloader of Rails. It is mandatory starting with Rails 7.0. Sometimes, a model needs to know...

When using Rails credentials, you will edit the encrypted credentials for staging or production environments from time to time. To...

While the main goal always is to prevent long-running queries in the first place, automatic timeouts can serve as...

This talk shows simple and advanced usages of the ruby/debug debugger. It goes through a step by step debugging workflow...

The ActiveSupport::BroadcastLogger allows you to log to multiple sinks. You know this behavior from from the rails server command...

Rails' default logger prefixes each log entry with timestamp and tags (like request ID). For multi-line entries, only the...

With this command you can run all the spec files which have been edited or added in the current branch...

I recently stumbled over a quirk in the way Ruby handles local variables that I find somewhat dangerous. Consider:

makandra dev

While most Rails Apps are tied to at least one external REST API, machine-to-machine communication via GraphQL is...