bloggo ergo sum

Month: April, 2008

Smarter Git Prompt

After posting my git prompt shell snippets, someone pointed out on news.YC pointed out my daftness. All you need is the following in your .bashrc: PS1 = ‘$(git branch &>/dev/null; if [ $? -eq 0 ]; then echo “\[\033[00m\]{$(git branch | grep ^*|sed s/\*\ //)}”; fi)\$\[\033[00m\]‘

debugging macro snippet

I wish I could say I came up with the below, and I suppose I did, but I more or less gathered two or three techniques I didn’t come up with into a few lines to code to make a macro useful for debugging. Its primary merits are readable output and extreme ease of use. [...]

Picking up a Lisp

I’ve recently gone back to learning Lisp. I used it a little bit in graduate school to do some homework assignments in one of my algorithms class and learned some of the basics there, but since I started my professional career, I haven’t gone back to it at all until now. I got Paul Graham’s [...]

Useful Git Prompt

Here’s a snippet of bash script that I wrote to make my prompt tell me when I’m in a git repository and what branch I’m on. And to my pleasant surprise, the PROMPT_COMMAND mechanism will respect color codes, so if you have your branch listings in git colorized, it will be reflected in your prompt. [...]