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

jQuery's find looks in the element's descendants. It will never return the current element itself, even if the...

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

jquery.com

Since jQuery 3 saw it's first release candidate today, the links has a list of (breaking) changes.

When you run rake db:rollback and nothing happens, you are probably missing the latest migration file (or have not...

github.com

Adds missing native PostgreSQL data types to ActiveRecord and convenient querying extensions for ActiveRecord and Arel for Rails 4.x...

guides.rubyonrails.org

ActiveRecord offers an explain method similar to using EXPLAIN SQL statements on the database. However, this approach will explain all...

developer.mozilla.org

When building a form with a file select field, you may want to offer your users a live preview before...

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.

Instead of using this hack you might want to use MariaDB 10.x which can work with both old and...

OAuth requires a set of params to be carried along requests, among which a nonce. Some libraries pass these along...

jQuery's deferred objects behave somewhat like standard promises, but not really. One of many subtle differences is that there...

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

You can find out about disk space usage of all tables within your database by running this: SELECT table_name...

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

To upload a file via AJAX (e.g. from an ) you need to wrap your params in a FormData object.

about.gitlab.com

When full text search is overkill and like queries do not deliver this might be an approach you could try...

github.com

Stackprof is a sampling call-stack profile for Ruby 2.1+. Instead of tracking all method calls, it will simply collect...

If you are on a Linux shell and want to open a file with whatever default application is configured for...

Let's say you want to find the element with the text hello in the following DOM tree: hello

TL;DR There are three dimensions you can control when scoping routes: path helpers, URL segments, and controller/view module.

Our preferred way of testing ActiveRecord is to simply create/update/destroy the record and then check if the expected behavior has...

Validations should be covered by a model's spec. This card shows how to test an individual validation. This is...