Skip to content

Instantly share code, notes, and snippets.

@hoolymama
hoolymama / .bashrc
Created March 20, 2011 10:51
tcsh style filename modifiers in bash
# in tcsh you can do stuff like this:
# set f = /foo/bar/myfile.0076.jpg
# echo $f:r:e
# --> 0076
# echo $f:h:t
# --> bar
# In bash its a mess so I wrote some functions to make it possible.
e() # the extension
path=https://github.com/api/v2/yaml/issues/open/duxlabs/giraffe
user=your_user
pass=your_password
title="Maya Integration"
body="Integrate Autodesk Maya"
curl --user ${user}:${pass} -F "login=${user}" -F "title=${title}" -F "body=${body}" ${path}
title="Get 3rd party Licenses"
body="Adobe CS, Fusion, Houdini"
window;
columnLayout;
textField "nodeTF";
showWindow;
textField -e -cc "showMatches(\"nodeTF\")" "nodeTF";
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
PS1="\[\033[1;33m\]\u@\h:\w $(parse_git_branch)>\[\033[0m\] "