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 >= 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...
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...
tl;dr: Upgrade the gem to at least 4.0.1 When you use rspec_rails in a version < 4 with Rails...
If your project depends on an old version of ImageMagick that you can no longer install in your system, you...
bundle outdated [--filter-major|--filter-minor|--filter-patch] Example output for bundle outdated --filter-major Other examples
By default, your terminal emulator (Gnome Terminal, Terminator, etc.) sets some kind of window title to reflect the shell type...
Rails 6 includes a WYSIWYG editor, Action Text. It works out of the box quite well, but chances are that...
In case Ruby does not detected the expected encoding of a file automatically you can specify the known encoding manually...
When testing with Cucumber / Caypbara, iframes are ignored, so you can't interact with them. To interact with your iframe...