profile picture
I create software products, usually web applications.
Current interests: Data Science, Data Visualizations, Machine Learning, Ruby, Rails, CoffeeScript, D3.js

Overriding Rails 3 database configuration depending upon platform

Place this file in something line lib/extensions/configuration_extensions.rb:

And update your config/environment.rb file:

Select table names from SQL Server from a Mac via ActiveRecord and TinyTDS driver

Your /usr/local/etc/freetds.conf file should look something like this:

Change host in freetds.conf to your host name of the I.P. address of the host.

Here’s a simple test:

Also, change :database, :username, and :password in ss_ar_tinytds_test.rb accordingly.

Retrieving Twitter account from Mac OS X Lion’s Address Book via MacRuby

The code assumes Mac OS X 10.7. Also, the code could be represented differently (i.e. without using a Range) if ABMutableMultiValue behaved like a Ruby Array or supported .to_a

Ruby Array extension method to return array elements as quoted strings

Ruby Array extension method to return array elements as quoted strings: