A Rails script lives in lib/scripts and is run with bin/rails runner lib/scripts/.... They are a simple tool to perform...

developer.mozilla.org

Today I learned that you can animate HTML elements using the Web Animation API's method .animate(keyframes, options) (which...

sitepoint.com

Multiply by 1x the unit: $number = 13 $length = $number * 1px // => 13px Removing a unit

It happens from time to time that a job in a GitLab pipeline fails. Sometimes, however, the error message is...

jetbrains.com

RubyMine has a collaboration feature called "Code With Me". Using it, you can invite someone into your local editor to...

You can ignore certain commits when using git blame with the --ignore-revs-file option. This is handy to ignore...

Getting an entire test suite green can be a tedious task which involves frequent switches between the CLI that is...

In the Gitlab settings the flag Auto-cancel redundant pipelines is enabled by default. This auto-cancels jobs that have...

#pluck is commonly used as a performant way to retain single database values from an ActiveRecord::Relation Book.pluck(:title, :price...

ruby-doc.org

Ruby has the class Rational which allows you to store exact fractions. Any calculation on these variables will now use...

Every modern Rails app should have a Content Security Policy enabled. Very compatible default The following "default" is a minimal...

stackoverflow.com

For some reason you have to pass the password hash if you want to create a role in postgres. To...

All direct child directories of app are automatically added to the eager- and autoload paths. They do NOT create a...

TLDR Using .includes or .eager_load with 1-n associations is dangerous. Always use .preload instead. Consider the following ActiveRecord...

Given you have an array column like this: create_table "users", force: :cascade do |t| t.integer "movie_ids", default: [], array...

We regularly have tasks that need to be performed around a deploy. Be it to notify operations about changed application...

Both knapsack and parallel_tests have the option to split groups by historic execution time. The required logs for this...

makandra dev

There are multiple ways to redirect URLs to a different URL in Rails, and they differ in small but important...

Rails' url_for is useful for generating routes from a Hash, but can lead to an open redirect vulnerability.

Rails' Strong Parameters enable you to allow only specific values from request params to e.g. avoid mass assignment.

An introduction to mangling When you minify ("compress", "optimize") your JavaScript for production, the names of your functions and variables...

TL;DR: Grid elements have min-width: auto in a 1fr column, which may lead to overflows. With minmax(0...

When you write your next CarrierWave uploader, consider processing your images with libvips instead of ImageMagick. Reasons for libvips

Ctrl + Alt + S > search "rubocop on save" Under "Inspections", check the highlighted box on rubocop -a Caveat: This adds a...