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...
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...
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.
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...
The linked page lists and explains global Ruby "dollar" variables, such as: $: (load path) $* (ARGV) $? (Last exit status) $$ (PID)
Using CSS sprites for background images is a technique for optimizing page load time by combining smaller images into a...
Put the attached files into your home directory and enjoy. .irbrc defines interesting_methods, which is essentially all methods without...
We have often felt the pain where our models need to serve too many masters. E.g. we are adding a...
For example if you use rvm and get this message: ERROR: Loading command: install (LoadError) no such file to load...
TL;DR: You should generally use #size to count associated records. size Counts already loaded elements If the association is...
Here is a hacky way to load dumps directly from the source server, without fully copying them over and extracting...
tl;dr: Do not use merge! for session hashes. Use update instead. Outline Let's assume you're modifying the...