If you want to collapse/expand elements with dynamic content (and thus unknown height), you can not transition between height: 0...

Note: You won't need this for single lines of text. In this case it is better to just use...

Sometimes you'll find yourself with a set of tasks that require similar code for different models. For example, if...

stefanjudis.com

Suppose you want to implement a publish/subscribe pattern in your Frontend application to react to data changes and events. First...

Using querySelector or querySelectorAll in JavaScript, you can easily find descendants of a node that match a given selector.

makandra dev

We have a long-standing checklist for merge requests. However, it hardly matches the intricate requirements for design. This checklist...

Code splitting is a feature of esbuild that can keep huge libraries out of the main bundle. How code splitting...

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

You have an async function that rejects: async function failingFunction() { throw new Error("Something went wrong") } When you call that...

If you're using a Redis cache in Rails (e.g. :redis_cache_store), it's possible to configure additional parameters...

Capybara has a variety of finder methods like find_button to help you look up DOM elements. There are also...

When you use native smooth scrolling there is no built-in method to detect the end of the scrolling animation...

The change_column method for rails migrations support casting with a custom SQL statement. This allows us to change a...

makandra dev

Rails partials have a lot of "hidden" features and this card describes some non-obvious usages of Rails Partials.

In the past we validate and set default values for boolean attributes in Rails and not the database itself.

HTTP header values must only contain low-ASCII (7-bit) characters for safe transport. From RFC 7230: Historically, HTTP has...

Not all email clients support external images in all situations, e.g. an image within a link. In some cases, a...

phili.pe

The linked article found a simple way to rewrite legacy git aliases to make them work with differently named default...

To read the current breakpoint tier in JavaScript, employ this CSS: :root { --current-breakpoint-tier: xs; @media (min-width: $screen...

makandra dev

In a Jasmine spec you want to spy on a function that is imported by the code under test. This...

Usually, Unpoly compiler destructors are returned from the compiler function. However, when using async compiler functions, you can not register...

The cards editor has a feature "Cite other card" to create links to other cards in the same deck as...

Jasmine specs for the frontend often need some DOM elements to work with. Because creating them is such a common...