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

makandra dev

Promises are the new way™ to express "Do this, and once you're done, do that". In contrast to callbacks...

If you need to modify (e.g. add 2px) a Sass variable that defines multiple values as one (e.g. for short...

To simulate Rails' to_sentence in your JavaScript application, you can use these few lines of CoffeeScript code: joinSentence = (array...

Here is a symbol of an eight note: ♪ Its two-byte hex representation is 0x266A. This card describes how to...

When building a web application, one is tempted to claim it "done" too early. Make sure you check this list...

tenderlovemaking.com

You can define methods using def or define_method. In the real world, there is no performance difference.

makandra dev
css-tricks.com

All new browsers support the new object-fit CSS property. It allows to specify how an element behaves within its...

jakearchibald.com

The way that Javascript schedules timeouts and promise callbacks is more complicated than you think. This can be the reason...

to create a Gallery that has a name and has_many :images, which in turn have a...

The attached ImageLoader helper will start fetching an image and return an image that is resolved once the image is...

makandra dev
thecssninja.com

Sometimes you want to preload images that you will be using later. E.g. if hovering over a an area changes...

To delay your entire Jasmine test suite until the DOM is ready, add the following: beforeAll(function(done) { $(done); });

When you have a localized website, you may want to redirect users to their preferred language when they visit the...

github.com

fake_stripe spins up a local server that acts like Stripe’s and also serves a fake version of Stripe.js...

You can use JavaScript to get or set cookie values on the client. Using the vanilla JavaScript API

gist.github.com

The NestedHash class allows you to read and write hashes of any depth. Examples: hash = {} NestedHash.write hash, 'a', 'b', 'c...