Method delegation in Rails can help you to keep your code organized and avoid deep call chains (law of demeter...

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

haml.info

Haml renders HTML with indentation reflecting the nesting level of elements. When it comes to white-space preserving content, this...

Given there is a user with an attachable avatar: class User < ApplicationRecord has_one_attached :avatar end

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...

Ubuntu 24 added some guarding for Python packages which no longer allows installing applications through pip on system level. Instead...

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...

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

makandra dev
w3.org

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...

github.com

The new params.expect method in Rails 8 improves parameter filtering, addressing issues with malformed input and enhancing security. It provides...

makandra dev

Bundler allows you to specify the name of the Gemfile you want to bundle with the BUNDLE_GEMFILE environment variable...

makandra dev
impactahead.com

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

To reverse lookup a fixture by its table name and id, use the following approach on ActiveRecord::FixtureSet: table = 'users...

makandracards.com

Updated for selenium-webdriver 4.27 which requires options.add_option(:page_load_strategy, 'none').

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...

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

If you update Selenium regularly, you'll run into deprecation warnings similar to: WARN Selenium [:clear_local_storage] [DEPRECATION] clear...