First of all: You could just use RVM which would make the pain go away. If for some reason you...
You can use the whatlanguage gem to detect the language of a Ruby string. Note that it also has not...
WMD is a simple, lightweight HTML editor for blog comments, forum posts, and basic content management. You can add WMD...
Expiration of Rails sessions By default Rails sessions expire when the user closes her browser window. To change this edit...
When submitting textareas, browsers sometimes include carriage returns (\r) instead of just line feeds (\n) at the end of each...
There are two distinct ways of commenting Haml markup: HTML and Ruby. HTML comments This will create an HTML comment...
This is an awesome gadget in your toolbox, even if your test coverage is great. gem install ruby-debug (Ruby...
If you added a file by mistake, you can unstage it (but keep local changes) by saying git reset HEAD...
Rails 3, 4, 5, 6 config/application.rb config/environment.rb before the initialize! call (we don't usually edit this file)
Update RubyGems and Passenger Bundler requires Rubygems >= 1.3.6. Run gem update --system if you have an older version.
There are three ways to define your own RSpec matchers, with increasing complexibility and options: 1) Use RSpec::Matchers.define
When deploying Rails applications you might have noticed that JS and CSS are not cached by all browsers.
When working with times and dates in Rails applications, you need to deal with the following problem: In Rails, Time...
Use this if you want to show or hide part of a form if certain options are selected or boxes...
The Git stash does not work like a one-slot clipboard and you might shoot yourself in the foot if...
So you screwed up and copied Paperclip secrets from one project to another. Here is a semi-automatic, painful way...
The following counts all the lines in all *.rb files in the app directory. Run several of these commands to...
Reverting a commit means creating a new commit that undoes the old changes. Imagine the following commit history:
The following Sass will do it: hr color: #ddd background-color: #ddd border: none height: 1px
An alternative to this technique is using VCR. VCR allows you to record and replay real HTTP responses, saving you...
Open the configuration file: gksudo gedit /usr/share/vte/termcap/xterm Find a line like this: :co#80:it#8:li#24:\
In a nutshell: to avoid your shell character set from messing with imports, use -r to export and SOURCE when...
ALTER DATABASE database_name CHARACTER SET "utf8"; ALTER DATABASE database_name COLLATE "utf8_unicode_ci"; After that, for...
Ancestry is a gem/plugin that allows the records of a Ruby on Rails ActiveRecord model to be organised as a...