Given there is a user with an attachable avatar: class User < ApplicationRecord has_one_attached :avatar end
Ubuntu 24 added some guarding for Python packages which no longer allows installing applications through pip on system level. Instead...
When debugging slow SQL queries, it’s helpful to understand the database engine's query plan. Whenever you execute a...
How to retrieve connection information from memcached. printf "stats\nquit\n" | nc 127.0.0.1 $MEMCACHED_PORT | grep connection
Using ffmpeg, you can easily re-encode a video to reduce its file size. Command Do it like this:
If you need to pre-generate a scram-sha256 password hash for use with postgres, e.g. for using it with...
In Slack, the settings dialog only offers a fixed selection of fonts. You can use any font you like using...
This decision tree describes how to use the alt attribute of the element in various situations. For some types of...
The new params.expect method in Rails 8 improves parameter filtering, addressing issues with malformed input and enhancing security. It provides...
Bundler allows you to specify the name of the Gemfile you want to bundle with the BUNDLE_GEMFILE environment variable...
Also see the list of IRB commands. Switching the context Changes the "default receiver" of expressions. Can be used to...
$ cat ~/.config/mimeapps.list # open Archives with FileRoller and not extract them immediately, wich is the new behaviour when clicking archives in...
To reverse lookup a fixture by its table name and id, use the following approach on ActiveRecord::FixtureSet: table = 'users...
Your package-lock.json should always match and resolve all packages from your package.json. Coming from Yarn, I was looking for an...
TL;DR: Rails ships two methods to convert strings to constants, constantize and safe_constantize. Neither is safe for untrusted...
If you update Selenium regularly, you'll run into deprecation warnings similar to: WARN Selenium [:clear_local_storage] [DEPRECATION] clear...
tl;dr When a cookie includes an Expires attribute or an HTTP response includes caching headers like Expires or Cache...
In FactoryBot factories, Rails' file_fixture is not available by default. To enable it, include a support module from rspec...
Some key highlights and points from the linked article TestProf II: Factory therapy for your Ruby tests. The Problem with...
Rails slightly changed the fragment cache implementation from Rails 7.0 to Rails 7.1. Unfortunately, this is incompatible with how Haml...
Text fragments allow linking directly to a specific portion of text in a web document, without requiring the author to...
Capistrano 3 has a doctor task that will print information about Environment: Ruby, Rubygems and Bundler versions List of Capistrano...
Rails' fragment caching caches subtrees of an HTML document tree. While constructing that tree though, it can be really hard...
Git has the concept of hooks: bash scripts that are invoked at certain points in the Git lifecycle. One handy...