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

In newer passenger versions the output of passenger -v has changed. capistrano-passenger tries to parse the version and now...

To attach files to your records, you will need a new database column representing the filename of the file...

makandra dev
web.archive.org

The attached article examines what the percent unit (%) is relative to in CSS The article does a great job of...

I use the TypeScript compiler for this, since its output is more minimal than Babel's. The following will transpile...

ruby-lang.org

Ruby 3.0 introduced a breaking change in how it treats keyword arguments. There is an excellent blog post on the...

I really love to use the shortcuts CTRL+Alt+ Arrow Left and CTRL+Alt+ Arrow Right to navigate through the...

When you have a hex color code, you can easily convert it into its RGB values using plain Ruby.

tableconvert.com

https://tableconvert.com/ is an online tool to convert tables between different formats (e.g. json, markdown, csv).

We prefer to run our end-to-end tests with headless Chrome. While it's a very stable solution overall...

When your Rails application server raises error, Capybara will fail your test when it clears the session after the last...

makandra dev

When your application is open for public sign up and sends out transactional e-mails to a large number of...

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

The ActionDispatch module of Rails gives you the helper method flash to access the flash messages in a response.

makandra dev
github.com

capybara-lockstep can help you with flaky end-to-end tests: This Ruby gem synchronizes Capybara commands with client-side...

json is part of the standard library of Ruby and deals with JSON, obviously. As you know, JSON is the...

makandra dev

5.4.0 2021-02-01 Compatible changes Add geordi branch command that checks out a feature branch based on a story...

labs.bishopfox.com

The linked article shows that there are unclear parts in the JSON specification and that different parsers treat them differently...

We had the issue, that a VCR spec failed, after updating CarrierWave from version 0.11.0 to 1.3.2. In this version...

ZSH is an alternative command line shell that includes some features like spelling correction, cd automation, better theme, and plugin...

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

CarrierWave comes with a set of default configuration options which make sense in most cases. However, you should review these...

makandra dev
mixedcontentexamples.com

The pages […] allow you to see different types of mixed content and test how they behave in your browser. The...