You should prefer native promises to jQuery's Deferreds. Native promises are much faster than their jQuery equivalent. Native promises...

Native promises have no methods to inspect their state. You can use the promiseState function below to check whether a...

I often see the use of || to set a default value for a variable that might be nil, null or...

Capybara clears cookies before each scenario, but not other client-side data stores. If your app is using localStorage or...

Webpack is the future. We're using it in our latest Rails applications. For tests, we want to compile assets...

This card will show you a cool way to define a class using Struct.new. A common usecase for Structs are...

makandra dev

ChromeDriver clicking works by simulating a mouse click in the middle of the element's first client rect (or bounding...

Middleman is a static page generator that brings many of the goodies that Rails developers are used to.

makandra dev

This card compares patterns to store trees in a relation database like MySQL or PostgreSQL. Implementation examples are for the...

makandra dev
javascript.info

To move elements around we should be familiar with coordinates. Most JavaScript methods deal with one of two coordinate systems...

medium.com

As web developers, we know how easy it is to end up with web page bloat. But loading a webpage...

stackoverflow.com

window.getSelection().toString(); Browser support: IE9+, Android 4.3+, Safari 5+

developer.mozilla.org

You can easily have a JavaScript hash/object that returns a default value for unset keys/properties – as long as you need...

There seems to be a nasty bug in Chrome 56 when testing with Selenium and Capybara: Slashes are not written...

Just like we use gems on the server, we use third party JavaScript libraries in the browser. These typically provide...

medium.freecodecamp.com

Collection of useful tools in the Chrome JavaScript console. Make the whole page editable This is not special to Chrome...

TLDR: A function is hard to use when it sometimes returns a promise and sometimes throws an exception. When writing...

Plot graphs in Ruby WebGraphviz renders in your browser via JavaScript (to store the rendered graph, extract the SVG using...

TL;DR Debugging problems with javascript errors in cucumber tests is sometimes easier in the browser. Run the test, stop...

clipboardjs.com

We used zeroclipboard.js in some of our projects but now we switched to clipboard.js because it does not rely on...

github.com

This might be relevant for us since we're often managing customer documents in our apps. I played around with...

Same requests are recorded only once in vcr. Replaying a test fails, if you trigger the same request multiple times...

There is no build in functionally in jQuery and Prototype to extract params from a url. You can use this...

weareoutman.github.io

ClockPicker is a JavaScript and Bootstrap implementation of an Android-style time picker which looks and feels great. Unfortunately, it...