If your Webpack build is slow, you can use the Speed Measure Plugin for Webpack to figure out where time...
Sometimes you want to load code on demand. For instance, when a a large library is only used on a...
Webpack builds can take a long time, so we only want to compile when needed. This card shows what will...
Use rules to include or exclude jobs in pipelines. Rules are evaluated in order until the first match. When a...
Installing gems on a server that has no access to the internet (especially rubygems.org) requires to bundle the gems into...
Generate a password htpasswd -Bn firstname.lastname This will ask you for a password and use bcrypt (-B, more secure) and...
When you need the DOM node of a tag (e.g. to read extra attributes, or to modify the DOM near it), you can usually reference it via document.currentScript. However, document.currentScript is unsupported in ancient browsers, like Internet Explorer 11 or wkhtmltopdf's Webkit engine. If you are not running async scripts, you can easily polyfill it: document.scripts[document.scripts.length - 1] It works because document.scripts grows with each tag that was evaluated. That is also the reason why this solution will not work reliably for async code. Demo: https://codepen.io/foobear/pen/poRLxQm
To attach files to your records, you will need a new database column representing the filename of the file...
I use the TypeScript compiler for this, since its output is more minimal than Babel's. The following will transpile...
Ruby 3.0 introduced a breaking change in how it treats keyword arguments. There is an excellent blog post on the...
When you have a hex color code, you can easily convert it into its RGB values using plain Ruby.
https://tableconvert.com/ is an online tool to convert tables between different formats (e.g. json, markdown, csv).
We prefer to run our end-to-end tests with headless Chrome. While it's a very stable solution overall...
When your Rails application server raises error, Capybara will fail your test when it clears the session after the last...
When your application is open for public sign up and sends out transactional e-mails to a large number of...
In Ruby (almost) everything is an Object. While this enables a lot of powerful features, this concept might be confusing...
To ensure Spring is not running: bin/spring stop pkill -f spring To prevent Spring from starting again: export DISABLE_SPRING...
json is part of the standard library of Ruby and deals with JSON, obviously. As you know, JSON is the...
We had the issue, that a VCR spec failed, after updating CarrierWave from version 0.11.0 to 1.3.2. In this version...
ZSH is an alternative command line shell that includes some features like spelling correction, cd automation, better theme, and plugin...
By default parallel_tests will spawn as many test processes as you have CPUs. If you have issues with flaky...
CarrierWave comes with a set of default configuration options which make sense in most cases. However, you should review these...
tl;dr: Upgrade the gem to at least 4.0.1 When you use rspec_rails in a version < 4 with Rails...
A rough guide how to implement a REST API. The discussion here includes some interesting points as well: Timestamps: ISO8601...