Given there is a user with an attachable avatar: class User < ApplicationRecord has_one_attached :avatar end
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
When debugging slow SQL queries, it’s helpful to understand the database engine's query plan. Whenever you execute a...
Using ffmpeg, you can easily re-encode a video to reduce its file size. Command Do it like this:
Hint If you are using our opscomplete.com hosting we can set all environment variables mentioned below for your deployment on...
This decision tree describes how to use the alt attribute of the element in various situations. For some types of...
Rails wraps your parameters into an interface called StrongParameters. In most cases, your form submits your data in a nested...
Elements can be hidden and shown by toggling the display property. However, this is not animatable, so we often turn...
$ cat ~/.config/mimeapps.list # open Archives with FileRoller and not extract them immediately, wich is the new behaviour when clicking archives in...
Your package-lock.json should always match and resolve all packages from your package.json. Coming from Yarn, I was looking for an...
With Ubuntu 24.04 it's not longer possible to setup FDE with BTRFS The new installer won't offer you...
TL;DR: Rails ships two methods to convert strings to constants, constantize and safe_constantize. Neither is safe for untrusted...
In development, we store files using ActiveStorage's disk service. This means that stored files are served by your Rails...
In FactoryBot factories, Rails' file_fixture is not available by default. To enable it, include a support module from rspec...
When Ruby objects are inspected in any modern IRB, some objects (like ActiveRecord instances) are rendered with neat colors and...
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...
YJIT is Ruby's default just-in-time compiler. It is considered production-ready since Ruby 3.2 (source).
Git has the concept of hooks: bash scripts that are invoked at certain points in the Git lifecycle. One handy...
The general purpose T instance types are a good starting point. But depending on the CPU utilization of your workload...
A lesser known fact about PG enums is that they are ordered. This can be really handy when values have...
We recently migrated a Rails application from yarn to npm. We decided to go this step instead of upgrading to...
Zeitwerk is the new autoloader of Rails. It is mandatory starting with Rails 7.0. Sometimes, a model needs to know...