mac snippets

Installing ImageMagick, mini-magick and rmagick on Mac OS X Leopard

Tagged imagemagick, attachment_fu, rails, ruby, mac, osx, leopard, mini-magick, rmagick  Languages ruby

I had no success installing ImageMagick and mini-magick with the instructions I found on this page but after some googling I found this blog post, which had the magic commands that worked for me:

sudo port install tiff -macosx  #disables the linkage with Apple's open gl
sudo port install ImageMagick

sudo gem install rmagick
sudo gem install mini_magick

To test mini-magick, open an irb console and paste in the following code:

require 'rubygems'
require 'mini_magick'

path = "public/images/0000/0003/logo.jpg"
image = MiniMagick::Image.new(path)

#print width and height
puts image[:width]
puts image[:height]

Deleting favicons in Firefox 3

Tagged mac, osx, firefox, favicon  Languages bash

To force Firefox to show your updated favicon (updating favicon.ico is not enough), first quit Firefox. Then issue the following commands in the terminal:

$ cd /Volumes/Macintosh\ HD/Users/christian/Library/Application\ Support/Firefox/Profiles/46xov8kt.default
$ sqlite3 places.sqlite 
SQLite version 3.5.0
Enter ".help" for instructions
sqlite> 
sqlite> delete from moz_favicons;
sqlite> update moz_places set favicon_id = NULL;
sqlite> .quit