When you allow file uploads in your app, a user might upload content that hurts other users. Our primary concern...

Every Rails response has a default ETag header. In theory this would enable caching for multiple requests to the same...

In Ruby on Rails ActiveRecord::Relation#merge overwrites existing conditions on the same column. This may cause the relation to...

Maintaining larger projects makes it more difficult to balance refactoring and upgrade tasks according to its actual value. Consider to...

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

By activating strict_loading you force developers to address n+1 queries by preloading all associations used in the index...

makandra dev

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

thepugautomatic.com

How a macro can dynamically define a method that can be overridden with super in the same class.

makandra dev
ruby-doc.org

TLDR if you define a equality method for a class you must also implement def hash. Ruby has a lot...

makandra dev

Timecop is a great gem to set the current time in tests. However, it is easy to introduce flakyness to...

makandra dev

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

tl;dr The Chrome DevTools are a neat collection of tools for the daily work as a web developer. If...

You can use ETags to allow clients to use cached responses, if your application would send the same contents as...

One rule of thumb I try to follow in capybara tests is using capybara matchers and not plain rspec matchers...

makandra dev

tl;dr git checkout is the swiss army of git commands. If you prefer a semantically more meaningful command for...