In a nutshell: Use git rebase --onto target-branch source-commit target-branch means "branch you want to be based...
Sometimes, you may want to open up a second database connection, to a read slave or another database. When doing...
Take care in queries where multiple AND or OR operators are used. In doubt, always use braces to enforce precedence...
When deploying, Capistrano puts a REVISION file into your application's release directory. It contains the hash of the commit...
I highly recommend that you make use of RubyMine's feature to pin tabs. When you pin all "important" files...
Today, I ran into trouble on a fairly fresh installed VM, running Ubuntu. I tried to bundle install and got...
When you use method_missing to have an object return something on a method call, always make sure you also...
Consider this Sass: .comment width: 320px; height: 240px; Any textarea with the comment class will be sized 320 by 240...
When refactoring a sequence of steps to a new, more descriptive step, you can use the steps method and Ruby...
Applications often show or hide elements based on viewport dimensions, or may have components that behave differently (like mobile vs...
In Rails 3.1+, instead of defining a separate up and down method you can define a single method change:
It's the last bugfix release. We will get another year of security fixes, then no more patches.
In moderately complex authorization scenarios you will often find yourself writing a map like this: class NotesController < ApplicationController power :notes...
ActiveSupport::Memoizable will be removed from Rails and has a lot of strange caveats that will ruin your day.
How to make class_attribute behave like class_inheritable_attribte which no longer exists in Rails.
Rack has a limit for how many form parameters it will parse. This limit is 65536 by default.
Lately, I came across a nasty error. I had a class Article that included FooTrait and BarTrait. In BarTrait, I...
I posted a solution which is awesome and also does natural sorting.
Sometimes you need to remove high Unicode characters from a string, so all characters have a code point between 0...
Ruby 1.9.2 is very slow when loading files, especially starting Rails servers or running specs takes forever.
In a nutshell: Capybara's find will not work properly on nodes from a list. Don't find on elements...
CSS is a lot easier to write and read than clumsy XPath expressions. So when you need to use XPath...
Note that this seems to affect only recent Rails 2 versions. You will not encounter this until you are writing...
Always use simply require 'spec_helper' If you mix it up like require 'spec_helper' require File.dirname(__FILE__) + '/../spec_helper'