After a clean install of Snow Leopard I decided not to use MacPorts but to go with homebrew. Its main advantages are no duplication (macports installed its own version of ruby, python and other libs) and the path layout: packages are installed into their own prefix (eg. /usr/local/Cellar/wget) and then symlinked into the Homebrew prefix (eg. /usr/local).
And because all of the formulas are in git, to add one you just fork the project on GitHub, push your formula and make a pull request. Because of that it’s one of the most forked project on GitHub.
That’s what I did and now you can install Tokyo Cabinet and Tokyo Tyrant from my fork (I hope it will be merged into master soon) from main repo:
brew install tokyo-tyrant
(yep, no sudo needed).

It’s been one month since I arrived in Manchester and I really like it. The University is great, I only have 5 courses and 20h per week (and lunch breaks).
But the thing that I like the most in Manchester are the user groups. I’ve been to North West Ruby User Group, GeekUp and want to go at the next Manchester Free Software talk and to Python North West. I will probably talk at the next NWRUG meeting so I strongly recommend you come (and maybe make a short talk as well).
[video]
mr. penumbra’s twenty-four-hour book store -
I wish I was at I/O to get the opportunity to play with Google Wave. I love the idea, and I think it’s limited only by what robots/gadgets makers think of doing with it.
At I/O there were some really interesting Office Hours sessions where you could go and talk to the engineering teams about questions and issues. I wanted to find out a bit more about Wave and so went along to their APIs one. At the end of a really interesting chat an understandably tired Douwe gave me a mysterious looking card and invited me to come up to Mountain View the following day to hack on the Wave APIs… amazing, thank you Douwe.
I liked the ARGy nature of the mysterious tr.im URL on a card with nothing else on it, which lead you to a webpage where you could sign up.
And a set of e-mails telling you where to go and how to get into the Waves sandbox. I had a few meetings in the morning in San Francisco I couldn’t miss and was worried it was getting too late to really build stuff when I got to the Hackathon so I spent most of the journey on the Caltrain up there looking through the docs, pulling together some simple ideas I could do in the 2 hours I’d have to code and also writing some very simple guestimate code based on the docs.
The ARGy nature of the day carried on with fantastic lo-fi handwritten signs telling you where to go which I wished I’d photographed. When I got into the hacking room there were about 50 of us including the Wave team and it was a real honour and pleasure to meet Lars and many of the others who’d made this exciting new thing.
Within about an hour or so (glad I already know AppEngine, all Robots are currently implemented in AppEngine) I had the Robot responding to the text properly and then in a little while longer I had the latest 10 stories from The Guardian Content API being pushed into the right Blip within the Wave. We’ll be covering my code over on the Open Platform blog and we’ll put a screencast of it in action there and here soon. I called it Grauniady, partly because of The Guardian’s pet name in the UK of The Grauniad, partly because a naming convention seems to have come out of the Wave team of robots ending in “y” and partly because Lar’s demo of the spell checking was just so amazing, it all seemed appropriate.
It was a really amazing day, some fantastic demos from all the developers which ranged from a collaborative drum machine and a piano embedded in a Wave, to a robot from Twilio which looked for phone numbers and enabled a call between people, and recorded that call and embedded it in the wave (awesome demo). There were a couple of Robots which behaved like bots and responded to text.
Apart from the usual laptop/projector hookup mayhem Grauniady performed admirably and worked fine. Thanks to a Tory MP trying to claim for a “duck island” and Anna Pickard’s use of the word “cockweasel” in The Apprentice live blog I had some good funny examples to show (always good to hear laughter at something other than sketchy code). Obviously I was following Simon Willison’s convention of API demo’s involving animal names.
thanks to Pamela Fox for image above and for taking notes of the hacks in a wave.
Thanks to Kevin Marks for the perfectly timed lift back to Mountain View station (5 minutes later and I’d have been sitting on the platform for an hour). Love the double decker CalTrains, couldn’t stop grinning about them and the day on the way back. Totally memorable. Feel very lucky. Thank you.
Another script I stole from evilchelu is j.sh. It enables you to quickly jump to a folder that you often access by writing a small part of its name. I use it to quickly cd to my projects or other repositories with “j <a few letters>”
To install it save it somewhere (I use a bin/ folder in my home) and add “source <path to j.sh>” to your .bashrc or .bash_profile.
As I said on twitter, I now switched to Vim (MacVim specifically). I am using evilchelu’s vimrc which has FuzzyFinder (my favourite TextMate feature). It wasn’t that hard to get productive at acceptable level.
Any tips and/or recommendation ?
I wanted to share with you a list of videos and podcast that I listen to when I have some time.
About videos I posted earlier with recommended talks. Here’s some courses that I have seen (I got them from iTunes U):
I listen mostly to Ruby podcasts, to find out the latest news and opinions:
What do you subscribe to ? Have any informative video that you’d like to share ?
Just saw Innovation in Rails by Gregg Pollack and Jason Seifer (RailsEnvy guys) where they talked about the new things in the past year in the Ruby and Rails world. Confreaks posted high resolution 720p videos of the conference on their site.
Gregg showed how to use a reverse proxy cache to speed up your application. You can find links about the discussed topics on the RailsEnvy blog. Earlier Gregg Pollack also released a series of screencasts about scaling Rails debunking the myth that Rails can’t scale.
For my Rails projects currently I’m using Thoughtbot’s stack (Shoulda, factory_girl) and now I switched to Clearance. I love it because it’s tested and it’s easy to extend. One such modification that I need is to allow users to login with username. I wrote a demo app and here’s a tutorial on how to do it yourself:
1. Install clearance and run the generator
2. Test UsersController#new includes a username (or “handle” or whatever) text field
test/functional/users_controller_test.rb
And watch it fail:
test: The public When getting new User view should display username field.
(UsersControllerTest) [/test/functional/users_controller_test.rb:11]:
There must be a username field.
<false> is not true.
Add the field to app/views/users/_form.html.erb to fix it (it still won’t pass because the model does not have the username field yet):
<%= form.label :username %>
<%= form.text_field :username %>
3. Create migration to add username:
$ script/generate migration AddUsernameToUsers username:string
$ rake db:migrate
And update the factory test/factories/clearance.rb:
4. Test the User model to validate presence of username and to allow mass assignment
test/unit/user_test.rb should be:
Now the unit tests are failing, to fix them we need to add validations to the User model and make the username field accessible:
5. Test SessionsController#create that given a User’s username for the :email value, the User should be signed in
Which fails because we only check email. Add a test for the User#authenticate method so it checks email too:
Add the implementation to the User model and all tests pass:
Please post your suggestions/comments, this post was written at 2am and it may have inacurracies.