Bowtie doesn’t scrobble to last.fm, solution

Schermata 2009-08-29 a 21.10.32
Apparently there are some issues with Bowtie when using the last.fm integration.
Remember I’m using Snow Leopard.

Bowtie is a valid freeware alternative to CoverSutra for managing iTunes, showing cover art, current song, etc.

Using version 1.0b2 I found out two things:

  • if you open the preference pane, Last.fm and check “Enabled”, the checkbox goes automatically away
  • it doesn’t scrobble

A workaround to fix the first problem is to leave the checkbox alone and instead enable last.fm integration by right clicking the icon in the upper tray and selecting “Enable Last.fm”.

The solution to the fact that isn’t scrobbling is to capitalize your last.fm username in preferences, so for example if my username is “kain82″ I will write “Kain82″.

With those settings in place it does seem working, however I’ll keep this post as reference for future updates on the matter.

Oh, and if you’re into metal, add me to your friends over last.fm ;)

Glimmerblocker: block ads in Safari 64 bit mode on Snow Leopard

GlimmerBlocker
Safari AdBlock worked quite well, however since Input Managers are finally totally discontinued in Snow Leopard we can’t use it in Safari running 64 bit mode.

In fact, as the developer states, a new version of Safari Adblock is out in the wild but requires you to run Safari in 32 bit mode, by checking the appropriate flag in Get Info window of Safari.

But since I’m running a 64 bit operating system, kernel and application, I took a step further and began hunting for the appropriate tool and seems that I found it.

GlimmerBlocker doesn’t hack Safari, instead it runs a local proxy to filter ads, pretty neat if you ask me.

And for this reason after the installation you won’t find preferences directly in Safari, instead you’ll find them in your Control Panel, directly in 64 bit mode (PrefPanels that are still 32 bit requires you to reopen the whole Control Panel in 32 bit mode).

The only thing is that when blocking an ads, Adblock removed visually the ads, without leaving empty spaces, meanwhile GlimmerBlocker does (depends on the site you are visiting); however this doesn’t change the fact that it’s an excellent replacement.

There are also other solid features, ranging from creating your own lists, hacking with javascript to let a page behave like you want and showing youtube download links. By running a customizable proxy transparently like this possibilities are infinite, like using it with other browsers and other native applications which uses http. You can even setup your iPod or iPhone to filter ads when over WiFi.

Thumbs up for this software.

Ruby ordered hash tip with Rails

This is quite old, as many of you ruby coders knows that ruby 1.8 doesn’t keep a Hash ordered, while 1.9 does.

This is seldom necessary however, there are bit of codes where it’s important to have the Hash keep the order:

# ruby 1.8.7
>> {:a => "a", :c => "c", :b => "b"}
=> {:b => "b", :c => "c", :a => "a"}
# ruby 1.9.1
>> {:a => "a", :c => "c", :b => "b"}
=> {:a => "a", :c => "c", :b => "b"}

If then you’re using Rails and Ruby 1.8, instead of relying on some kind of black magic sorting by keys or values you can access directly the namespaced ActiveSupport::OrderedHash like this:

1
2
3
4
5
  def build_recurring_hash
    returning(ActiveSupport::OrderedHash.new) do |map|
      (1..5).each{ |n| map[n] = n }
    end
  end

Install Git from source on Snow Leopard 64 bit

There are many methods to get git running on Snow Leopard, this is the source approach.

Go to http://git-scm.com/ and download the latest package (1.6.4.3 as of writing).

Decompress it in a directory, and run this command:

make prefix=/usr/local all
kain-osx:git-1.6.4.3 kain$ lipo -detailed_info git
input file git is not a fat file
Non-fat file: git is architecture: x86_64

seems good, issue:

sudo make prefix=/usr/local install

to install.

test:

kain-osx:~ kain$ git --version
git version 1.6.4.3
kain-osx:~ kain$ which git
/usr/local/bin/git

Of course be sure that /usr/local/bin is in your $PATH.

My Rails .gitignore

config/database.yml
config/*.sphinx.conf
config/s3_credentials.yml
*~
*.cache
*.log
*.pid
tmp/**/*
.DS_Store
db/cstore/**
db/sphinx/**
doc/api
doc/app
doc/plugins
doc/*.dot
coverage/*
db/*.sqlite3
*.tmproj
*.sw?

To always ignore those files system-wide:

git config --global core.excludesfile /path/to/.gitignore

How to install pg (postgresql) gem on Snow Leopard, 64 bit

Install PostgreSQL from source/port for this, does not currently build against binary package.
PATH should be /usr/local/pgsql.

export PATH=/usr/local/pgsql/bin:${PATH}
env ARCHFLAGS="-arch x86_64" gem install pg

Or if you are using macports:

export PATH=/opt/local/lib/postgresql83/bin:${PATH}
env ARCHFLAGS="-arch x86_64" gem install pg

TextMate and Snow Leopard compatibility

Snow Leopard TextMate compatibility bundle

Update: Allan released a new Snow Leopard compatible build which does contains those workaround, therefore this bundle should not be necessary anymore, just update your TextMate copy.

There seems to be some problems with TextMate in Snow Leopard; for instance cmd+arrows doesn’t work by default.

Meantime Pat get his stuff sorted out you can download a TextMate bundle that tries to fix the problem.

Grab it here.