We often have a separate production branch that lags a bit behind the more cutting edge main branch. Sometimes you want to move some, but not all commits from main...

In esbuild, you usually import other files using relative paths: import './some-related-module' import `../../utils/some-utility-module` import `../../../css/some-css.sass` This is totally fine...

When storing floating-point numbers such as prices or totals in an SQL database, always use a DECIMAL column. Never...

makandra dev

Using git fixup helps you to speed up appending changes further back in the git history of your feature branch...

...only because your step definition requires that. Here's a typical step definitions that benefits from using find_by_anything: When /^I sign in as "([^\"]+)")$/ do |identifier| user = User.find_by...

The attached compiler() function below applies JavaScript behavior to matching HTML elements as they enter the DOM. This works like an Unpoly compiler for apps that don't use Unpoly...

makandra dev

If you have a fully functional CI pipeline but no CD, you might find yourself frequently waiting for CI (with...

...you will sign out your current user whenever you switch to another app. A better way is to use our own daho.im service. All daho.im subdomains resolve to your local...

Simplecov is a code coverage tool. This helps you to find out which parts of your application are not tested...

web.archive.org

...cat tmp/parallel_cucumber_failures.log | xargs geordi cucumber # Running features > Only: features/authentication.feature:33 features/backend/pages.feature:5 features/backend/pages.feature:60 ... Beside the linked article you might also be interested in reading An Opinionated Guide to xargs...

By default parallel_tests will spawn as many test processes as you have CPUs. If you have issues with flaky...

...e.g. wysiwyg text fields Consider to leave the paperclip columns (you can debug issues better) As many parts of file processing are not tested (resolution, fallback images and many more...

...exception notifier all failed jobs will trigger an email. Blocking the server: Mogrify (tool behind minimagic) sometimes freeze (for many thousand of jobs it will fail for sure). You need...

developer.chrome.com

The File System Access API is a new capability of modern browsers that allows us to iterate over selected folders...

We use Sentry to be informed about different kinds of issues. One of the key features is that you are...

There's a method Integer() defined on Kernel, that typecasts everything into an Integer. Integer("2") # 2 Integer("foo") # Invalid...

Array.wrap wraps argument in an array, unless it is array-like already. The behaviour is a bit saner than Array[...]. Array.wrap(nil) # => []

" foo bar \n \t boo".squish # => "foo bar boo" Time.current, Date.current, DateTime.current behaves like .now or .zone.now depending on whether a time zone is set

...in development + test, but keep action_on_unpermitted_parameters = false in production, your application behaves different between these environments. On the other hand it forces to fix these errors in...

...Parameters).to receive(:action_on_unpermitted_parameters).and_return(false) for tests, that should behave exactly like in production...

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

Rails offers the fresh_when method to automatically compute an ETag from the given record, array of records or scope...

Tested on Ubunut 22.04 1. Opener script Create a file ~/.local/bin/coverage_zip_opener with: #!/bin/bash tmp_folder="/tmp/coverage-report-opener" if [ -z "$1" ]

makandra dev
aaronlasseigne.com

All Rubyists should be familiar with the common definitions for include and extend. You include a module to add instance...

github.com

Let the following setup: # my_model_spec.rb describe MyModel do it 'perfoms a test' it_behaves_like 'something shared' end # something_shared.rb shared_examples_for 'something shared' do it 'does something'

...a test' is spec/models/my_model_spec.rb[1:1]. The ID of the ExampleGroup created by it_behaves_like 'something shared' is spec/models/my_model_spec.rb[1:2] as it is the second ExampleGroup in the...

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

=> #<Capybara::Node::Element tag="div" path=... If you rely on this behavior in Capybara 3, affected features will fail. The gem no longer normalizes whitespace when finding...

...visible css ".haystack" with text "Hi! Try to match me." Re-enabling Cabyara 2 behavior in Capybara 3 After digging in the documentation, you might figure out that you can...