url_for with added params
You cannot say this because url_for only takes one parameter: url_for(@deal, :tab => 'general') # won't work
Shell script to generate a Git commit with Pivotal Tracker story ID and title
We usually generate our commit messages from Pivotal Tracker IDs and titles, like [#15775609] Index view for conflicts
Configuring ActionMailer host and protocol for URL generation
When you generate a URL in a mailer view, ActionMailer will raise an error unless you previously configured it which...
Getting non-Aero toolbars for Thunderbird 5 on Windows 7
Thunderbird 5 brings a custom chrome on Windows Vista/7 that uses translucent Aero decorations on toolbars and menubars. Here is...
Run Selenium tests in Chrome instead of Firefox
Here is how to switch your Selenium to Chrome: Make sure you've got a recent version of chromedriver in...
How to fix: undefined method `specifications' (caused by RubyGems 1.8)
Sometimes, when running a rake task, RubyGems 1.8.5 raises an error: rake aborted! undefined method `specifications' for "/usr/lib/ruby/gems/1.8":String
markbates/coffeebeans
When CoffeeScript was added to Rails 3.1 they forgot one very important part, the ability to use it when responding...
How to use Git on Windows with PuTTY
Get "PuTTY Link" and "Pageant" (an SSH key agent) from the PuTTY download page. Run pageant.exe, find its icon inside...
Order in which RSpec processes .rb files
Because your examples should not change global state, you should not need to care about the order in which RSpec...
SSL: Build a Certificate signing request (CSR)
In order to request a SSL certificate from any dealer, you usually need a CSR certificate. As both the CSR...
Soft-scroll to an anchor with jQuery
This snippet makes links that refer to an anchor (like "...
...") scroll softly to it.\ In this example we only do...
Execution of shell code in Ruby scripts
Deprecated ways to execute shell code in Ruby This is just a reference for legacy code. For new code, always...
Sudo a gem executable does not work on Ubuntu
Today I needed to execute a ruby gem executable with sudo. But, surprisingly, bash would tell me command not found...
How to define helper methods in magic DSL code
We use the lambda-technique to DRY up our Rails routes machinist blueprints, and, of course, RSpec examples.
Putting static content on Cloudfront
We recently decided to put static content for HouseTrip.com to Amazon Cloudfront for a faster user experience. This happens fully...
Capistrano 2: Which Capistrano hooks to use for events to happen on both "cap deploy" and "cap deploy:migrations"
When deploying an application with "cap deploy" by default [1] you only deploy your code but do not run migrations...
Why a Rails flash message is shown twice
You set a flash message and it shows up as it should. However, it is displayed again the next time...
How to send HTTP requests using cURL
Reading a URL via GET: curl http://example.com/ Defining any HTTP method (like POST or PUT): curl http://example.com/users/1...
How to perform HTTP basic authentication in RSpec
The Basic Authentication header encodes username and password. Effectively, it's just Base64 plus a "Basic" prefix.
Installing RMagick on Ubuntu
When installing RMagick you may get an error messages like this: Version 2.13.1: checking for Ruby version >= 1.8.5... yes
Opera 11: Show full address, including GET parameters
By default, Opera 11 hides any passed params and the URL's protocol until you focus the address bar.
wycats/artifice
Artifice allows you to replace the Net::HTTP subsystem of Ruby with an equivalent that routes all requests to a...
Cancelling event propagation
Within an event handler, there are multiple methods to cancel event propagation, each with different semantics. event.preventDefault() Only prevents the...
Caching in Rails
The information in this card is only relevant for Rails 2.3-era apps. This note gives a quick introduction into...