Mihai Anca

Oct 21 2009

Homebrew

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).

Comments (View)
Oct 19 2009

Manchester

University of Manchester

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).

Comments (View)
Sep 01 2009

Since July I have joined the awesome team at uberVU. I really like challenges and their goal to track the whole social media sounded very exciting. During this time I learned a lot of new things (like Python) and discovered how to cope with the amount of new information being generated on the internet.

This video shows what we have accomplished so far.

ubervu:

It’s easy. Search for a keyword and we can tell you where are the people discussing that keyword, how many of them there are and what are the conversations you should get engaged in.

As opposed to buzz tracking technologies that track mentions of your name or brand, our service is oriented around which people are interacting with your content or content about you and whether you are engaging those people or not. This approach turns the tables on buzz tracking by focusing on measuring and growing your community - building relationships and loyalty with people - rather than maximizing mention count without regard to people or relationships.
Comments (View)
Jun 12 2009
Comments (View)
May 30 2009

Google Wave Hackathon at Mountain View

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.

jaggeree:

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.

Comments (View)
Mar 27 2009

Quick jump to folder

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.

Comments (View)
Mar 24 2009
Comments (View)
Mar 08 2009

Videos and podcasts

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 ?

Comments (View)
Feb 15 2009

Acts_as_conference videos

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.

Comments (View)
Feb 11 2009

Clearance - login with username

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.

Comments (View)
Page 1 of 2