Posts filed under "OSX"

Autotest and Me

Today, Mark and I were talking about some of the open source projects we've been working on. During our conversation, he mentioned how David's recent post about using Autotest on OSX was the catalyst for him to start using it on his projects. I decided that I would do the same, so I went about using it on a Ruby gem that I'm developing.

From the original post, using it on Rails is pretty straightforward, but getting it to work on a vanilla Ruby project requires a bit of tweaking. There's some outdated information out there, but I was able to find a solution that worked for me. My resulting .autotest file:

require 'autotest/growl'
require 'autotest/fsevent'

Autotest.add_hook :initialize do |at|
  at.clear_mappings

  at.add_mapping %r%/^lib/(.*).rb$% do |_, m|
    possible = File.basename(m[1])
    files_matching %r%^test/.*(#{possible}_test|test_#{possible}).rb$%
  end

  at.add_mapping(%r%^test/.*.rb$%) {|filename, _| filename }
end

With that patch in place, I get the results I want.

Taming Your Feeds

I while back I was inspired by a talk that Clinton gave about maximizing developer efficiency, so I set out to find ways of improving my own efficiency. As part of that process, I ended up changing how I go about reading all the RSS feeds that I track. It's a simple approach that's worked for me for some time, so I thought it worth sharing.

In the beginning, there was categorization

Once I started using a Macbook, I ditched my NetVibes account and picked up a free copy of NetNewsWire since I no longer needed to read my feeds online. As part of this switchover, I spent a bit of time categorizing all the feeds that I had at the time. I dropped feeds into well-named buckets like "Programming" or "Contacts", etc..

While this was a very organized way of keeping track of feeds, it wasn't quite efficient when it came time to actually read them.

Then came prioritization

After spending some time analyzing my habits, I discovered that there were certain blogs that I wanted to devote more attention to and others that I could just safely skim. The thought occurred to me: why not just have 2 groups, one for reading and one for (gasp!) skimming? So, that's what I did:

read / skim

As I add new feeds I can quickly drop them into the appropriate bucket, and I can also promote or demote feeds into either bucket depending on the value I derive from the content. Each day, I can focus on the important content in my "Read" list and then burn through the items I need to skim.

The Inevitable MySQL Gem Install

Got your new box all set up? Let's do some Rails:

$ rake db:create
!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please 
install the mysql gem and try again: gem install mysql.

rake aborted!
no such file to load -- mysql

If you're on Ubuntu, do this:

$ sudo apt-get install libmysqlclient15-dev 
$ which mysql_config
/usr/bin/mysql_config

$ sudo gem install mysql -- --with-mysql-config=/usr/bin/mysql_config
Building native extensions.  This could take a while...
Successfully installed mysql-2.7
1 gem installed

If you're running on OSX and have installed mysql from MacPorts, mysql_config is already installed:

$ sudo gem install mysql -- --with-mysql-config=/opt/local/bin/mysql_config5

Done.

Dot-Underscore Hell

A frustrating situation courtesy of OSX and mounted drives (over SMB in this case):

linux-host$ svn status
?      site/actions/._contact.php
M      site/actions/contact.php
?      site/conf/._controller-config.ini
?      site/conf/._nav-config.php
M      site/conf/nav-config.php
?      site/templates/._contact.php
M      site/templates/contact.php

Luckily, there's a command for that (OSX Leopard):

mac$ dot_clean .


linux-host$ svn status
M      site/actions/contact.php
M      site/conf/nav-config.php
M      site/templates/contact.php

See man dot_clean for more information. Credit to MacWorld for this tip.

Update: Since posting this, Brian pointed out that this is most likely a setting inside of TextMate. To disable, just run this command from a terminal:

defaults write com.macromates.textmate OakDocumentDisableFSMetaData 1

Do not run this using sudo if you want it to work (I found out the hard way).