Author Archives: Tony

Country Seed Data for your Rails App

Never go looking for basic country seed data again: [ { :name => 'Afghanistan', :iso_two_letter_code => 'AF' }, { :name => 'Aland Islands', :iso_two_letter_code => 'AX' }, { :name => 'Albania', :iso_two_letter_code => 'AL' }, { :name => 'Algeria', :iso_two_letter_code => 'DZ' }, { :name => 'American Samoa', :iso_two_letter_code => 'AS' [...]
Posted in Software | Tagged , , , | 3 Comments

Simple Quarter Select – Rails plugin for Q1,Q2,Q3,Q4 selector

Have you ever wanted a select component for Quaters of the Fiscal Year (Q1,Q2,Q3,Q4)? The Simple Quarter Select Ruby on Rails plugin does it for you. It’s highly configurable and maps to the month of any datetime attribute in your model. Why map the quarter to a datetime attribute? I think the answer is obvious but [...]
Posted in Software | Tagged , , , , | Leave a comment

Scaling a Rails Application – Thinking About the Full Stack

I found a great presentation about scaling web applications that I wanted to share with the world. Enjoy! Scaling a Rails Application from the Bottom Up If you enjoyed this post, make sure you subscribe to my RSS feed!
Posted in Software | Tagged , , , | Leave a comment

Getting FancyUpload to work with Rails

FancyUpload is a slick looking file uploader with a progress bar. However, it’s not completely obvious how to get it working with your Rails application. I searched long and hard and found 2 pretty good examples here and here. The problem is that the former only works with Amazon S3, and the [...]
Posted in Software | Tagged , , , , , | 4 Comments

How to change a UIBarButtonItem in the iphone toolbar

I recently needed to add a custom button to the iPhone toolbar but it needed to have state. Specifically, I needed the ability to enable and disable it based on some conditions. I implemented this using two images for the button – one for enabled and one for disabled. First, add the button to the [...]
Posted in Software | Tagged , , | 3 Comments

B’more on Rails synopsis – April 2010

B’more on Rails is a community of Baltimore folks who use the Ruby programming language and the Ruby on Rails application framework. Check out our MeetUp page. Below is a brief synopsis from our April 2010 meetup. You can also download the slides here. Bundler is great for gem management. Among other [...]
Posted in Bmore On Rails Review, Software | Tagged , , , , , , , , , , , | Leave a comment

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/ # [...]
Posted in Software | Tagged , , , | 26 Comments

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 [...]
Posted in Random, Software | 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 , , , , , , , | 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. [...]
Posted in Software | Tagged , , , , | 2 Comments