Grep prints one line per match. To return the number if matches, use the -c switch: grep -c "something" filename...
This article from the FreeBSD Handbook suggests that editing /etc/rc.conf enables DHCP. Unfortunately, some times this seems not sufficient.
We have a big flat screen TV (Samsung LE46c650l1kxxu) in our conference room. Configuring it properly, we were encountering some...
Solarized is a sixteen color palette (eight monotones, eight accent colors) designed for use with terminal and gui applications. It...
Date::Performance is a gem that replaces various method in Ruby's Date class with fast C implementations. Unfortunately it...
Detecting if a Javascript is running under Selenium WebDriver is super-painful. It's much easier to detect the current...
Attached is a working config to deploy an application with Capistrano that needs to monitor Resque workers with God.
Vim allows recording a batch of commands as a macro. This is handy if you need to do the same...
The Capybara API is somewhat hard for parse for a list of methods you can call on a Capybara node...
tl;dr: Always have your attachment path start with :rails_root/storage/#{Rails.env}#{ENV['RAILS_TEST_NUMBER']}/. The directory where you...
Don't simply test for the presence of the magic Paperclip attribute, it will return a paperclip Attachment object and...
When you need to create a locale for a language variant (like Austrian for German), you probably don't want...
When you need to use diff in either some Ruby code or your Rails app, use the differ gem.
Under the same origin policy, a web page served from server1.example.com cannot normally connect to or communicate with a server...
Cross-Origin Resource Sharing (CORS) is a browser technology specification, which defines ways for a web service to provide interfaces...
If you are in the middle of a file and want to scroll, but don't want to move your...
The addon lets you set the format of the dates used for the year and month folders that the Archive...
This is now part of geordi. Please don't follow the instructions below, if you use geordi. Inspired by the...
Possible fixes: Upgrade your Firefox. It's fixed in 5.0. Hunt down funny float or overflow directives in your CSS...
Note: While the solution in this card should still work, we prefer another solution now: Hide your Selenium browser window...
Note: If you are currently working with Ruby 1.8.7 or 1.9.3, we recommend to upgrade to Ruby 2.1 first. From...
This note describes how to kick a user out of a Rails application after she hasn't requested an action...
When you create a temporary file (e.g. to store a generated Excel sheet) and try to send it to the...
In Rails 2, you could use link_to_remote...
...:update => 'id' to automatically replace the content of $('#id').