Balance your texts today with text-wrap: balance
So you have a heading that is just barely wider than the container it should fit into, and it wraps...
Checklist for Implementing Design
We have a long-standing checklist for merge requests. However, it hardly matches the intricate requirements for design. This checklist...
Best practice: How to manage versions in a Gemfile
It most cases it's not necessary to add a version constraint next to your gems in the Gemfile. Since...
Don't assert exceptions in feature specs
As we are slowly switching from Cucumber scenarios to RSpec feature specs, you might be tempted to write assertions like...
The numericality validator does not care about your BigDecimal precision
Looking at the source code of the validates_numericality_of validator, it becomes clear that it converts the attribute in...
Preventing users from uploading malicious content
When you allow file uploads in your app, a user might upload content that hurts other users. Our primary concern...
Rails: Fixing ETags that never match
Every Rails response has a default ETag header. In theory this would enable caching for multiple requests to the same...
ActiveRecord::Relation#merge overwrites existing conditions on the same column
In Ruby on Rails ActiveRecord::Relation#merge overwrites existing conditions on the same column. This may cause the relation to...
Project management best practices: Technical debt summary
Maintaining larger projects makes it more difficult to balance refactoring and upgrade tasks according to its actual value. Consider to...
Rails: Composing an ETag from multiple records
Rails offers the fresh_when method to automatically compute an ETag from the given record, array of records or scope...
Rails: Your index actions probably want strict_loading
By activating strict_loading you force developers to address n+1 queries by preloading all associations used in the index...
Rails Partials
Rails partials have a lot of "hidden" features and this card describes some non-obvious usages of Rails Partials.
HTTP headers can only transport US-ASCII characters safely
HTTP header values must only contain low-ASCII (7-bit) characters for safe transport. From RFC 7230: Historically, HTTP has...
Carrierwave: Custom file validations inside custom Uploaders
Carrierwave's BaseUploader can have some validations that you can use by overriding a certain method, which's expected name...
How to reliably center (block) icons vertically with text
vertical-align is hard. Have you ever wanted to vertically center an icon with text? This usually means "vertically align...
Timecop: reset after each test
Timecop is a great gem to set the current time in tests. However, it is easy to introduce flakyness to...
Jasmine: Mocking ESM imports
In a Jasmine spec you want to spy on a function that is imported by the code under test. This...
Heads up: network requests `Kernel#open` are not mocked with VCR
We usually rely on VCR and WebMock to prevent any real network connection when running our unit tests.
subscript, superscript and line-heights
By default subscript ( ) and superscript ( ) tags are styled with vertical-align: sub, respectively vertical-align: super by most browsers.
A modern approach to SVG icons
You have some SVG files you want to use as icons on your website. How would you embed them?
Using path aliases in esbuild
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: Creating DOM elements efficiently
Jasmine specs for the frontend often need some DOM elements to work with. Because creating them is such a common...
Jasmine: Cleaning up the DOM after each test
Jasmine specs that work with DOM elements often leave elements in the DOM after they're done. This will leak...
Chrome DevTools: Treasure (Overview)
tl;dr The Chrome DevTools are a neat collection of tools for the daily work as a web developer. If...