Rails partials have a lot of "hidden" features and this card describes some non-obvious usages of Rails Partials.
HTTP header values must only contain low-ASCII (7-bit) characters for safe transport. From RFC 7230: Historically, HTTP has...
Carrierwave's BaseUploader can have some validations that you can use by overriding a certain method, which's expected name...
vertical-align is hard. Have you ever wanted to vertically center an icon with text? This usually means "vertically align...
Timecop is a great gem to set the current time in tests. However, it is easy to introduce flakyness to...
In a Jasmine spec you want to spy on a function that is imported by the code under test. This...
We usually rely on VCR and WebMock to prevent any real network connection when running our unit tests.
By default subscript ( ) and superscript ( ) tags are styled with vertical-align: sub, respectively vertical-align: super by most browsers.
You have some SVG files you want to use as icons on your website. How would you embed them?
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...
Jasmine specs for the frontend often need some DOM elements to work with. Because creating them is such a common...
Jasmine specs that work with DOM elements often leave elements in the DOM after they're done. This will leak...
If you use third party APT sources you might end up with unmaintained packages after removing the external source or...
You can use ETags to allow clients to use cached responses, if your application would send the same contents as...
Here are a few common patterns that will probably lead to flaky specs. If you notice them in your specs...
tl;dr git checkout is the swiss army of git commands. If you prefer a semantically more meaningful command for...
You have uncommited changes (you can always check by using git status), which you want to discard.
tl;dr In RubyMine you can use find and replace with capture groups (.*?) and backreferences $1 (if you have several...
To allow HTTP 304 responses, Rails offers the fresh_when method for controllers. The most common way is to pass...
When you build a JSON API you need to come up with a style to represent attributes, pagination, errors or...
When working with feature branches, stale branches pile up over time. It's best to remove them right after merge...
It might sometimes be useful to check whether your Rails application accesses the file system unnecessarily, for example if your...
The gemspec for gems allows to add metadata to your gem, some of which have a special meaning and are...
This card explains how to generate an entity relationship diagram for your Rails application. We also show how to limit...