Skip to content

Instantly share code, notes, and snippets.

@baopham
baopham / git_commands.md
Created February 23, 2012 19:32
git commands notes

To delete a commit

Assuming you are sitting on that commit

git reset --hard HEAD~1

Or

@baopham
baopham / .bashrc
Created February 22, 2012 18:34
.bashrc
# Show git branch in bash prompt
__git_ps1 ()
{
local b="$(git symbolic-ref HEAD 2>/dev/null)";
if [ -n "$b" ]; then
printf " (%s)" "${b##refs/heads/}";
fi
}
alias la='ls -A'
alias ll='ls -l'
@baopham
baopham / RunScript.scpt
Created February 22, 2012 18:29
Textmate's Python bundle modified script to run in iTerm
#!/bin/bash
TPY=${TM_PYTHON:-python}
esc () {
STR="$1" ruby <<"RUBY"
str = ENV['STR']
str = str.gsub(/'/, "'\\\\''")
str = str.gsub(/[\\"]/, '\\\\\\0')
print "'#{str}'"
RUBY
@baopham
baopham / gist:1868420
Created February 20, 2012 08:27
FizzBuzz oneliner
#Rosetta Code
for x in range(1, 101):
print ''.join(['' if x%3 else 'fizz', '' if x%5 else 'buzz']) or x
@baopham
baopham / Monaco for Powerline.otf
Last active April 16, 2023 03:57
Patched font Monaco for OSX Vim-Powerline