Skip to content

Instantly share code, notes, and snippets.

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\] "
window;
columnLayout;
textField "nodeTF";
showWindow;
textField -e -cc "showMatches(\"nodeTF\")" "nodeTF";
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"
@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
@hoolymama
hoolymama / gist:1410680
Created November 30, 2011 20:29
delete all github repos
for r in `cat repoList.txt`
do
dt=`curl -u "my_username:my_password" https://github.com/api/v2/json/repos/delete/hoolymama/$r | cut -d"\"" -f4`
curl -X POST -u "my_username:my_password" -F "delete_token=$dt" https://github.com/api/v2/json/repos/delete/hoolymama/$r
done
@hoolymama
hoolymama / .bashrc
Created February 2, 2012 16:27
Applescript functions to set up iTerm and start working on a rails project.
alias sequin='cd $DEV/sequin;rvm use 1.9.2-p290@sequin'
@hoolymama
hoolymama / cli.rb
Created February 18, 2012 17:06
commandline thor generators with invocations
module Flak
class CLI < Thor
register(Generate, 'generate', 'generate <something>', 'Generate a new something.')
end
end
for f in `find ./ -name "*.cpp"`; do c=`tail -c 1 $f`; if [ "$c" != "" ]; then echo >> $f ; fi; done
@hoolymama
hoolymama / replace.sh
Created May 4, 2012 01:28
sed replace overwriting files
for f in `grep -rl darwin64 *`
do
sed 's/darwin64/linux64/g' $f > $f.new
mv $f.new $f
done
@hoolymama
hoolymama / holiday options
Created May 22, 2012 20:40
print date and date + 3 weeks for each week starting june 1st
require 'date'
d = Date.new(2012,6,1)
(0..52).each {|n| puts (d + (n*7)).strftime("%d/%m/%Y") + " "+ (d + ((n+3)*7)).strftime("%d/%m/%Y") }