Rails guide that covers PostgreSQL-specific column types and usages for Active Record. You should especially keep in mind the...
When you have an ngRepeat directive that uses track by, be sure to move the track by instructions to the...
capybara_element['attribute_name'] allows accessing an element's attributes in Capybara. A few examples: find('#my_element')['class']
When accepting GIF images, you will also accept animated GIFs. Resizing them can be a time-consuming task and will...
RSpec::Matchers.define :be_naturally_sorted do match do |array| array == array.natural_sort end end See RSpec: Where to put custom...
Chances are you're seeing the warning repeated a lot of times, maybe thousands of times. Here's how to...
If you want a class-like construct in JavaScript, you can use the module pattern below. The module pattern gives...
The Angular 1.2 way: # By default, angular returns undefined for invalid attributes which removes # the value from the form field...
SELECT enum_range(NULL::portal) # Returns an array of all possible values SELECT unnest(enum_range(NULL::portal)) # Unnests the...
Traveling Ruby is a project which supplies self-contained, "portable" Ruby binaries: Ruby binaries that can run on any Linux...
The Rails asset pipeline improves delivery of application assets (javascripts, stylesheets, images, fonts). Here are some basic facts about its...
Option 0: Download from the official page (preferred) Open https://googlechromelabs.github.io/chrome-for-testing/ In Section "Stable" > chromedriver / linux64 > Download ZIP from...
Sidekiq::Client.push('class' => 'WorkerClass', 'args' => [11, 5, 1993]) is equivalent to WorkerClass.perform_async(11, 5, 1993)
A very clever hack to parse a structured URL object is to create a element and set its href to...
If you get one of this errors: Error: Could not retrieve catalog from remote server: Error 400 on SERVER: ( ): found...
One of the many useful features of TextMate is autocompletion of words. If I were in TextMate right now, I...
Settings -> Editor -> General -> Smart Keys -> Unindent -> To nearest indent position RubyMine 7.0: Settings -> Editor -> General -> Smart Keys -> Backspace...
Hash#fetch is a great way to ensure that a hash key is present. The error message when a key...
Rails migrations allow you to use a change method whose calls are automatically inverted for the down path. However, if...
Upgrading from Ruby 1.8.7 to 2.1.2 took me an hour for a medium-sized application. It involved hardly any changes...
For our production servers we use Passenger as a Ruby application server. While it is possible to use Passenger for...
If you make a gem with Bundler, you will get a rake release task that will instantly publish your gem...
Using this gem I could get JSON generation from a large, nested Ruby hash down from 200ms to 2ms.
Firefox 5.0.1, which we were using for most Rails 2.3 projects, does not run on Ubuntu 14.04 any more. Here...