makandra dev

Sometimes you might need to nest a git-project inside another git-project. The right strategy is to use submodules...

makandra dev

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

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

css-tricks.com

The linked article shows what current browsers do when you click a link like this: 1-562-867-5309

Resources Rails Guide: Internationalization API Guide to localizing a Rails application Locale-aware helpers in ActionView::Helpers::NumberHelper

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

By convention, common protocols use a defined port, like 80 for HTTP or 443 for HTTPS. You can use nmap...

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

Chrome's developer tools automagically choose vertical or horizontal panel layout, based on their width. You can disable that magic...

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

github.com

Ever needed to use a global variable in Rails? Ugh, that's the worst. If you need global state, you...

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

Spreewald gives you the within meta step that will constrain page inspection to a given scope. Unfortunately, this does not...

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

makandra dev
github.com

This gem gives you a rake task db:seed:dump do create a db/seeds.rb from your current database state.

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

Current webkit browsers like Chrome and Safari have a special variable in their consoles that refers to the selected DOM...

gist.github.com

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

The attached Coffeescript helper will let you create mouse events: $element = $('div') Trigger.mouseover($element) Trigger.mouseenter($element) Trigger.mousedown($element) Trigger.mouseup($element...