Extremely Clean Way to Preload all Images

Are your images flickering since you aren’t preloading them? This is kinda annoying. There’s a simple solution. Read below. If you want an extremely clean, DRY, unobtrusive way to preload all images which are defined in your CSS without having to re-specify those urls as arguments into another JavaScript function, check out A New & […]

Search and Replace a Word in all Files within Directory

Use the following at your own risk. Save off your files within your directory somewhere first before running the following command. I’m posting these notes so I can refer back to them. If you want to search and replace a word in all files within a specified directory in Unix, do the following: For example, […]

Authlogic vs Devise for Authentication in Rails

The following post has been written by Brian Morearty. Here he compares Authlogic to Devise. I’m posting the following with his permission. "Here’s my comparison. Please keep in mind this is after only having used Authlogic for a few months (I used it on another project) and Devise for a few hours: Authlogic and Devise […]

Installing, Configuring and Troubleshooting PostgreSQL 9.0 in Rails 3 on OS X

The following may apply to other versions of PostgreSQL as well but I’m using version 9.0. I initially tried to install PostgreSQL via MacPorts but after running into issues I describe below, I ended up installing it via the Mac OS X package. If you want to skip issues I ran into with my macports […]

Handling 404s when RecordNotFound, UnknownAction and RoutingError

When handling 404s, you want to display the 404 page and return HTTP status 404 when a particular record is not found, the action requested is unknown or if there is a routing error. Add the following to your application_controller.rb file, towards the end:

Hidden Gems of Ruby 1.9

At GoGaRuco (Golden Gate RubyConf) in San Francisco, CA today… Talk by Aaron Patterson minitest require ‘minitest/autorun’ refute_equal (same as assert_not in TestUnit) inherit from MiniTest::Unit::TestCase Test Performance Run test with -verbose, you can see how long each test takes. minitest/spec (similar to rspec) ——— ObjectSpace ObjectSpace.each_object do |obj| p obj end count_object_size (to see […]

What is Arel?

What is Arel? Provides you Relational Algebra in Ruby. It’s included in Rails 3. Arel not an ORM. Arel – Ruby Relational Algebra Presentation

Lightning Talks at GoGaRuco

At GoGaRuco (Golden Gate RubyConf) today in San Francisco, CA The following is just some brief notes and may or may not make any sense. Talks went pretty quickly. Concurrency with Rubinius Ron Evans – TicketMaster (universal api) – allows migration of one system to another. (supports JIRA amongst other things) —– Fixture Builder by […]

Test-First Teaching

At GoGaRuco (Golden Gate RubyConf) in San Francisco, CA today… Why should you want to do this? By teaching you learn. Test-First Teaching: by Sarah Allen and Alex Chaffee Ruby Koans by Jim Weirich and Joe O’Brien Metakoans by ara.t.howard Ruby-Warrior by Ryan Bates

Data-Driven Government and the Ruby Developer

At GoGaRuCo (Golden Gate RubyConf) today in San Francisco, CA… Talk by Eric Mill who works at Sunlight Labs and who is working with government to make their data public. Here are some examples of where you can get data. Data SF.org Californa Data Chicago Every Block New York Data Mine United States Data GovTrack.us […]