Skip to content

Instantly share code, notes, and snippets.

View EnriqueVidal's full-sized avatar
🤠
I know nothing

Enrique Vidal EnriqueVidal

🤠
I know nothing
View GitHub Profile
@iangreenleaf
iangreenleaf / funcs.sh
Created August 13, 2010 20:51
Git unsigned merge hook
function error_message {
echo -e >&2 \
"---------------------------------------------------------------------------------------------------------" \
"\n$1" \
"\n---------------------------------------------------------------------------------------------------------"
}
function undo_merge {
error_message "Undoing your merge. Please fix the problem and try again."
@smathy
smathy / Chapter 05.markdown
Created November 6, 2009 21:43
Learn to Program

Chapter 2

Each one builds on the previous, ie. I re-use constants defined earlier.

Hours in a year

HOURS_IN_DAY = 24
DAYS_IN_YEAR = 365.242199
HOURS_IN_YEAR = HOURS_IN_DAY * DAYS_IN_YEAR

puts "Hours in an astronomical year: #{HOURS_IN_YEAR}"

@smathy
smathy / .ackrc
Last active September 3, 2015 22:25
Various config files for Rails, github, etc..
--type-add=ruby=.haml,sass=.sass
@smathy
smathy / .bash_profile
Created July 21, 2009 23:57
git and svn tracking prompt
current_git_branch() {
git_exists=`git branch 2>/dev/null | sed -ne'/^\* /s///p'`
if [[ "$git_exists" != "" ]]; then
if [[ "$git_exists" == "(no branch)" ]]; then
git_exists="\e[31m\]$git_exists\e[0m\]"
fi
echo "$git_exists "
fi
unset git_exists