Wednesday, April 29, 2009

Git Branch on the command prompt

It is sometimes very useful to know the git branch you are working on right from the command prompt. You can do this by editing the ~/.bashrc file.



This will show up a prompt which looks like this and fails gracefully when you are not on a git repo.


vagmi@deepthought:~/work/testproj[master]$ git checkout new_feature
Switched to branch "new_feature"
vagmi@deepthought:~/work/testproj[new_feature]$ cd ..
vagmi@deepthought:~/work$


This saves a lot of "git branch" when you are coding.

Wednesday, April 22, 2009

Liquid and Sinatra

Liquid is a templating language used when you need safety for your templates. I was planning to build a CMS and Liquid fit the needs of a templating library really well. I also like Sinatra for its simplicity. Unfortunately, Sinatra did not have support for liquid yet so I went ahead and built one. You can get that from my liquid topic branch on github.

There are few significant changes that you need to care about when using liquid instead of ERB or HAML.


  • None of the local members or class members declared will be available in your template

  • The locals hash is respected even for the layout.

  • You have to use {{ content }} in your layouts, instead of yielding.



And finally a "hello world" sinatra app with liquid.



Do let me know if you like it.

Wednesday, April 15, 2009

Wednesday, April 01, 2009

Lets build something already

Have ever had the feeling that when you wanted to get started with something, something else had to be done first. If you are a lone hacker banging out code, you are probably fine as you know what you are building. You do not ever have to write it down. But in teams it is vitally important that everyone knows what they are actually building.

This is where product managers and project managers come in. They are supposed to have a holistic view of where the project is and where it is heading to. They are the communication hubs who deal with all sorts of information about a project and protect the team as virtual filters. The team then gets information from a single source. But you might ask what happens when there are multiple project managers and product owners but no developers in a planning meeting. The meetings tend to be something like this.



Fortunately, there is an easy way to deal with this. Get building something already. It is far easier to figure out if the presented solution fits your needs than to speculate on how it would look like. So to all the teams that are suffering from this analysis paralysis, this is my advice. Stop discussing and start building.