The code below shows a method #validate which uses Nokogiri to validate an XML document against an XSD schema. It...
When you need to bulk rename files you can not call "mv *.foo *.bar" to change the extension of all...
Note that this sounds good but is not good at all when hooking tasks on cap deploy (see this article...
When you try to remove a non-existing index using remove_index, the migration will incorrectly pass without an error...
You know Firebug as a Firefox extension but there is also a "Lite" version which runs purely off JavaScript.
A check if two date or time ranges A and B overlap needs to cover a lot of cases:
The difference between .bind(), .live(), and .delegate() is not always apparent. Having a clear understanding of all the differences, though...
Sometimes it is useful to define a named scope by implementing a static method with the scope's name on...
Given those modules: module A def foo; end def bar; end end module B end When you want to call...
This might be due to AppArmor denying the MySQL server access to most of the filesystem. You can instead use...
There are times when you need to send SQL to the database, like this: def self.some_count(field) field = connection.quote...
Then /^I should get a response with status (\d+)$/ do |status| response.status.should include(status) end Capybara Then /^I should...
I love ETags, but there’s something that annoys me: most implementations revolve around pulling a record out of a...
Find-as-you-type boxes are usually built by observing changes in a text field, and querying the server via...
This is for those who already own an SSL certificate (e.g. using it in the Apache HTTP Server) and need...
You cannot use Array#join on an array of strings where some strings are html_safe and others are not...
When you are using Apache for development, it still accepts connections from everyone in the same network as you.
If you want your application to display properly on iPad, iPhone or Android there are two things to do:
Update: This trick probably isn't very useful anymore in Ruby 2.x. The Ruby GC has improved a lot...
If you’re testing the behavior of deprecated code in your Ruby project, the warning messages littered throughout your spec...
Git allows you to do a binary search across commits to hunt down the commit that introduced a bug.
When your site is mapped into the URL-space of another server using mod_proxy, ProxyPass and ProxyPassReverse, all requests...
If you need to find out which of your local commits are not on the remote server do this:
I was recently confronted with the task of creating a two-column liquid layout with a header and footer in...