Inspired by recent "git shortcut" cards I figured it would be nice to have one of these for rebasing a...

Sometimes a link or input field has no visible label. E.g. a text field with a magnifying glass icon 🔎 and...

makandra dev

Besides their default styling properties, HTML elements have a semantic meaning. For example, an h1 tag is usually styled with...

Most browsers have built-in drag and drop support for different page elements like text and images. While this may...

git --fixup is very handy to amend a change to a previous commit. You can then autosquash your commits with...

The RSpec matcher tests if two HTML fragments are equivalent. Equivalency means: Whitespace is ignored Types of attribute quotes are...

This bookmarklet grabs a PivotalTracker story title, transforms it into a valid git branch name and automatically prepends your initials...

The attached compiler() function below applies JavaScript behavior to matching HTML elements as they enter the DOM. This works like...

tl;dr: Avoid to memoize methods with default (keyword) arguments! When you are using Memoized with default arguments or default...

When using custom properties in your stylesheets, you may want to set a specific property value to an existing variable...

After switching a project from Sprockets to Webpack, I started observing a bug that was hard to debug: Our...

We recently noticed issues with Chrome 75+ when having the w3c option enabled within the Selenium webdriver. It looks like...

I encountered a unlucky behavior of byebug 11.1.3 (the most recent version at time of writing) when using it with...

Matching the "space" character class For matching whitespaces in a regular expression, the most common and best-known shorthand expression...

rspec.info

rspec >= 3.1 brings a method and_wrap_original. It seems a bit complicated at first, but there are use cases...

When dealing with external data sources, you may have to deal with improperly encoded strings. While you should prefer deciding...

Sometimes you want to load code on demand. For instance, when a a large library is only used on a...

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

Browsers blocks abusable JavaScript API calls until the user has interacted with the document. Examples would be opening new tab...

makandra dev

In Ruby (almost) everything is an Object. While this enables a lot of powerful features, this concept might be confusing...

By default parallel_tests will spawn as many test processes as you have CPUs. If you have issues with flaky...