You can write regular expressions some different ways, e.g. /regex/ and %r{regex}. For examples, look here. Remember that it...
jamesgolick / resource_controller at Github module ResourceController module Actions def index load_collection before :index response_for :index end
The following example is from the Cucumber wiki: Given a blog post named "Random" with Markdown body """ Some Title, Eh...
So you screwed up and copied Paperclip secrets from one project to another. Here is a semi-automatic, painful way...
traits.js is a minimal, standards-compliant trait composition library for Javascript.
This is called "cherry-picking". git cherry-pick commit-sha1 Note that since branches are nothing but commit pointers, cherry...
YARD 0.6 adds the ability to serve documentation for gems as well as the current project with yard server. Just...
Ruport’s acts_as_reportable module provides support for using ActiveRecord for data collection. You can use it to get...
An alternative to this technique is using VCR. VCR allows you to record and replay real HTTP responses, saving you...
String manipulation extensions for the Underscore.js javascript library.
home_run is an implementation of ruby’s Date/DateTime classes in C, with much better performance (20-200x) than...
A fake filesystem. Use it in your tests.
Ancestry is a gem/plugin that allows the records of a Ruby on Rails ActiveRecord model to be organised as a...
This may be awkward to set up, but will work once you're done. Fun facts:
Dir.glob(File.join RAILS_ROOT, 'app', 'models', '*.rb').collect{ |path| path[/.+\/(.+).rb/,1] }.collect(&:camelize).collect(&:constantize)
When a paperclip attachment gains a new style and you have many attachments, reprocessing can take ages. This is because...
Until May 2011 our gems have been created with Jeweler, which is a helper library to package code into a...
With defaults, RCov doesn't work the way you how you would like it to. To create a nice test...
To test concurrent code, you will need to run multiple threads. Unfortunately, when you use blocking system calls (e.g. locks...
For arrays of objects, uniq does not work as expected, since it uses strict equality. So [[1], [1]].uniq() == [[1...
To parse XML-documents, I recommend the gem nokogiri. A few hints: xml = Nokogiri::XML(" foo bar ") parses an xml...
sudo gem install gettext --no-ri --no-rdoc sudo gem install fast_gettext --no-ri --no-rdoc script/plugin install git://...
install apache sudo apt-get install ruby1.8-dev sudo gem install passenger sudo passenger-install-apache2-module follow the instructions
When you need to patch an existing gem, one way is to "vendor" the gem by copying it into the...