Upgrading from Ruby 1.8.7 to 2.1.2 took me an hour for a medium-sized application. It involved hardly any changes...

github.com

Using this gem I could get JSON generation from a large, nested Ruby hash down from 200ms to 2ms.

api.rubyonrails.org

To avoid n+1 queries, you want to eager-load associated records if you know you need to access them...

zerosixthree.se

See attached link. The gist is: .element { position: relative; top: 50%; transform: translateY(-50%); } Works in all web browsers and...

makandra dev
github.com

Parses URLs of social networks to extract IDs or screen names. It does not get confused by child routes: you...

In whenever you can schedule Ruby code directly like so: every 1.day, :at => '4:30 am' do runner "MyModel.task_to...

blog.salsify.com

An all-in-approach to fix the problem of pending AJAX requests dying in the browser when the server ends...

When your Rails controller action responds with only a simple text, render text: 'Hello' may not be what you want...

When using @media CSS queries, Internet Explorer 8 and below will fail to respect them. Though there are several options...

relishapp.com

Sometimes you have a test expectation but actually want a better error message in case of a failure. Here is...

I had a huge MySQL dump that took forever (as in: days) to import, while I actually just wanted to...

In Ruby, classes and modules are called constants. This card explains how Ruby resolves the meaning of a constant.

Install and configure the AWS Command Line Interface Show existing certificates to test if the AWS Cli is working:

ng-newsletter.com

Search engines, such as Google and Bing are engineered to crawl static web pages, not javascript-heavy, client-side apps...

Ubuntu has a package mysql-sandbox that lets you install multiple MySQL versions into your user home: Install mysql-sandbox...

Rails has always included a scaffold script that generates a default controller implementation for you. Unfortunately that generated controller is...

So you client has asked you to implement a row of buttons to like the URL on Facebook, Twitter and...

There may be reasons to change the locale of your Postgres cluster. A popular one is your development system's...

Using text-transform: uppercase - especially on form labels - can cause you serious headaches in Selenium tests. Sometimes the web driver...

After running bundler / gem install I could not load nokogiri lately. It died with cannot load such file -- nokogiri/nokogiri.

When two classes implement the same behavior (methods, callbacks, etc.), you should extract that behavior into a trait or module...

jimneath.org

The linked page lists and explains global Ruby "dollar" variables, such as: $: (load path) $* (ARGV) $? (Last exit status) $$ (PID)

makandra dev

Using CSS sprites for background images is a technique for optimizing page load time by combining smaller images into a...

makandra dev
rakeroutes.com

Put the attached files into your home directory and enjoy. .irbrc defines interesting_methods, which is essentially all methods without...