hair regrowth products

sublime text 2 commandline launcher

Sublime Text 2 has a rather nice command line launcher but it’s tucked away.

I put a bin directory on my path – I put that in my home directory.  The link below would work just as well with /usr/local/bin or similar…

OSX version

ln -s /Applications/Sublime\ Text\ ~/bin

Then launch it as follows from any directory to open with a directory tree in the side panel. ( Drop the ‘ . ‘  if you want just a plain window )

Add a file name if you want to open just that file

subl .
subl ./myfile.go

git command line – git commit hash – long and short

This will generate the long git commit hash of the current commit at HEAD

git rev-parse HEAD

This will generate the short git commit hash of the current commit at HEAD

git log --pretty=format:'%h' -n 1


how to get git to temporarily ignore a tracked file

There are times when you need to temporarily modify a file that git’s tracking, but you’ll never want to push it back to everyone else.

Of course it’s fine to modify the file and just not include it in a commit, but there is a neat solution to avoid it continually showing in git status commands.

It tended to annoy me if I did a pull and also we had some scripts that insisted on clean git repositories before they’d run.  There’s always git stash of course, but this feels like an elegant way to deal with the problem.

FWIW I wasn’t so keen on the solution that I found on github here which suggests using

git rm --cached <file>

I’d prefer to tell git to temporarily ignore the file.

With this method, it won’t show as changed in git status and it won’t get staged or committed, even in wildcard commands like   git commit .

git update-index —assume-unchanged <file>


git update-index —no-assume-unchanged <file>

I sourced this from on the link below, but note that there may be some manual work to do, described in the final paragraph:


When these flags are specified, the object names recorded for the paths are not updated. Instead, these options set and unset the “assume unchanged” bit for the paths. When the “assume unchanged” bit is on, git stops checking the working tree files for possible modifications, so you need to manually unset the bit to tell git when you change the working tree file. This is sometimes helpful when working with a big project on a filesystem that has very slow lstat(2) system call (e.g. cifs).

This option can be also used as a coarse file-level mechanism to ignore uncommitted changes in tracked files (akin to what .gitignore does for untracked files). Git will fail (gracefully) in case it needs to modify this file in the index e.g. when merging in a commit; thus, in case the assumed-untracked file is changed upstream, you will need to handle the situation manually.

bash command prompt for git

This is a great bash script for changing you command prompt so you can see your git  branch Put this into your .bash_profile

parse_git_branch() {
  git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'


PS1="\u@\h:$YELLOW\w$GREEN \$(parse_git_branch)$LIGHTGRAY: "

Here’s an example of it working

bash script showing git branch

bash script showing git branch

You can play around with the colours to match your terminal…