benmabey.com

Bryan talked about the differences between imperative and declarative scenarios. In my opinion, both styles have benefits and should be...

redmine.org

Phillip Koebbe from Ruby on Rails suggested inserting following code between the "bootstrap" and "initialize" sections of enviroment.rb. This hack...

makandra dev

The information in this card is only relevant for Rails 2.3-era apps. This note gives a quick introduction into...

Sometimes you can make your life easier by not allowing a record attribute to be changed after the record was...

devstructure.com

blueprint is DevStructure’s workhorse tool that looks inside popular package managers, finds changes you made to configuration files, and...

makandra dev
github.com

The shell variable PS1 holds your bash prompt. You might want to change it to serve your needs best. Here...

When you need to insert many records into the same table, performance may become an issue. What you can do...

If you have the following deprecation warning after upgrading to rails >= 2.3.10 DEPRECATION WARNING: The :overwrite_params option is deprecated...

rhnh.net

In order to cover some edge cases you rarely care about, Range#include? will become very slow in Ruby 1.9...

makandra dev
innig.net

If you want to get a deep understanding of how closures, blocks, procs & lambdas in Ruby work, check out the...

adobe.com

Flash movies (.swf files) can talk with Javascript code embedded in the same HTML page. There are two ways to...

Note: For PostgreSQL you should use advisory locks. For MySQL we still recommend the solution in this card.

web.archive.org

When you have a Cucumber step like Then I should see "Did you see those \"quotation marks\" over there...

The code below shows a method #validate which uses Nokogiri to validate an XML document against an XSD schema. It...

getfirebug.com

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:

alfajango.com

The difference between .bind(), .live(), and .delegate() is not always apparent. Having a clear understanding of all the differences, though...

Given those modules: module A def foo; end def bar; end end module B end When you want to call...

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...

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...

cssdiscussion.com

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...