April 22, 2010

Installing sphinx on mac osx with mysql installed through macports

wget http://sphinxsearch.com/downloads/sphinx-0.9.8.1.tar.gz
tar xzvf sphinx-0.9.8.1.tar.gz
cd  sphinx-0.9.8.1/
./configure --with-mysql-libs=/opt/local/lib/mysql5/mysql/
--with-mysql-includes=/opt/local/include/mysql5/mysql/
make
sudo make install

September 9, 2009

Duplicate Active Record with has_many relationships

old_model.find(old_model_id)
new_model = MyModel.new(old_model.attributes)
new_model.some_collection << old_model.some_collection.collect{|x| x.clone}
new_model.save

August 27, 2009
February 21, 2009
February 9, 2009
June 18, 2008
February 1, 2008
January 23, 2008

Burning .dmg to disk - not enough space

I had a problem where i had a 580mb dmg and wanted to burn to 700mb CDR… For some reason, Disk Utility prevented me from burning saying that the disk size wasn’t big enough. I ran the following command on a folder with the .dmg file and it converted it to an .iso. Disk Utility then allowed me to burn to the same CD:

hdiutil makehybrid -o isofilename folderwithdmg

This should create isofilename.iso which you should be able to burn with disk utility.

January 16, 2008
January 10, 2008