...using the latest version, or enterprise users might be using Firefox ESR which lags behind in features. For those, we want to use well-supported CSS features.
...background color, with a different lightness. Lightness values above 60 stay positive, values below become negative; multiplying by 1000 causes them to clip the 0..100 range and CSS will...
Removing features and merging those changes back can be painful. Here is how it worked for me.\
Capistrano is quite verbose during deploy. In practice, almost all of its output is noise to me. It would be...
...the resulting record will not have the attributes that defined that scope, and this behavior can be quite useful. Because you cannot have the best from both worlds you should...
...article and make informed choices about how to define your conditions. Also see the Best Practice section below. The problem in detail Consider this Rails class and the following articles...
Systemd's networkd will drop IP-Addresses configured by other processes like Keepalived's VRRP, when it is restarted. This...
s keeps saturation unchanged. calc(100 - l) inverts lightness. For example, 0% becomes 100%, and 100% becomes 0%. Example usage .demo { --inverted-color: hsl(from currentColor calc(h...
In long diffs, it can become impossible to spot small changes in larger blocks of moved code. This may be either a method that was moved from the top to...
When using Rails to truncate strings, you may end up with strings that are still too long for their container...
Development environment setup Rails Composer Basically a comprehensive Rails Template. Prepares your development environment and lets you select web server...
} Enumerable#index_with (Rails 6+) To generate a hash where array elements become hash keys, and values are calculated from them, use index_with. users = User.all
You can not use the hash_including argument matcher with a nested hash: describe 'user' do let(:user) { {id: 1...
We're usually running Ubuntu LTS versions. Sometimes newer hardware requires packages from more recent Ubuntu releases that only come...
use Postgres' lower() function add an index on lower(email) Probably the best approach is to just convert emails (and usernames) to lowercase within Rails. Popular authentication libraries...
...for Rails 2 and 3. Recently, caching with timestamp- or content-based keys has become more popular which saves you the pain of invalidating stale caches. How to enable/disable caching...
...member', :home_page end It has some limitations: Only works for singular member references ("belongs to"), not for a collection of references ("has many") No support for deletion (but could...
This page lists many query methods and options in ActiveRecord which do not sanitize raw SQL arguments and are not...
Website that offers lots of different kinds of HTTPS configurations, bad or good or complicated. They also offer a dashboard...
tl;dr The :is() pseudo selector - specificity of its most specific argument - matches against a comma-separated list of selectors...
...file. Note that this is # not guaranteed to be 100% accurate. It performs a "best guess" based # on a simple test of the first +File.blksize+ characters. # # Example: # # File.binary?('somefile.exe') # => true...
tl;dr The :where() pseudo selector - zero specificity - matches against a comma-separated list of selectors. Example Compound selectors like...
Rails offers a way to prepend (or append) view paths for the current request. This way, you can make the...
Sidekiq 7 adds a new feature called capsules. Use cases: a chrome queue limited to 1 for e.g. PDF processing...
...more information about this issue. In Rails3+ you can also disable this annoyingly clever behavior. Why this is bad This has some develish implications for your deployment, because scopes written...
...t notice this during development. Let's say you have a model Note which belongs to an Author and has a string column category: class Note < ActiveRecord::Base
A primer on vector graphics For rastered image formats like JPG or PNG, each pixel is basically drawn on a...