Category Archives: Software
Install MySQL on Mac OS X 10.6 and add StartupItem
Installing MySQL on Mac OS X 10.6 took a bit of digging around. Here is a consolidated tutorial. I am leaving out sudo commands for convenience. Use them where you don’t have permission.
# create the directory where you will keep your MySQL binary distribution
mkdir ~/src
cd ~/src
# download mysql binary distribution from http://dev.mysql.com/downloads/mysql/
# [...]
Recovering off screen windows in Mac OS X
I constantly lose windows on OS X. I think it’s because sometimes I am connected to an external monitor so OS X gets confused when I am not. I found a great solution online that I would like to re-post here so that I never have to look for it again and I [...]
Also posted in Random 2 Comments
Converting Table Data to YAML for Testing in Ruby on Rails
One of my clients has a huge application with no test suite. I am helping the company migrate to Rails 2.3 as well as remove some bottlenecks from their code. I needed to convert around 10 look-up tables to YAML’s so that I could load the data as fixtures and test the application [...]
Posted in Software Tagged database, rails, rake, rubyonrails, tasks, testing, utilities, yaml 2 Comments
Getting jQuery, Rails, and Authenticity Tokens to play nice
For anyone that uses the jQuery AJAX library to send POST requests to their Rails application, you have probably found that the built in Rails CSRF protection does not play nice with your jQuery POST requests. By the way, if you don’t know what CSRF is, check out my Ruby on Rails security presentation. [...]
Ruby on Rails – Skipping validations based on where object is created
I ran into an issue today where I wanted to skip validations based on where an object was created. To be more specific, I wanted to validate strictly if a “venue” was created through my web interface but I want to skip validations when importing venues. The reasoning is pretty simple, I want [...]
Posted in Software Tagged active-record, Ruby On Rails, rubyonrails, skipping-validations, validations 6 Comments
Back links for your Ruby on Rails application
Here is a nice little helper I wrote to display back links:
def back_link
link_to "« Go Back", request.env["HTTP_REFERER"].blank? ? "/" : request.env["HTTP_REFERER"]
end
If you just use the HTTP_REFERER without checking if it’s blank, weird things can happen if someone lands on your page from an email, for example.
If you enjoyed this post, make [...]

Scaling a Rails Application – Thinking About the Full Stack