Skip to content

Instantly share code, notes, and snippets.

View shaunsantacruz's full-sized avatar

Shaun Santa Cruz shaunsantacruz

View GitHub Profile
@shaunsantacruz
shaunsantacruz / gist:da122ef4e30afb0b2499
Created August 20, 2014 21:42
Colorful Bash Prompt, inspired by "Extravagant Zsh Prompt"
# Colorful Bash Prompt, inspired by "Extravagant Zsh Prompt"
# Screenshot: http://img.gf3.ca/d54942f474256ec26a49893681c49b5a.png
# A big thanks to \amethyst on Freenode
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then export TERM=gnome-256color
elif infocmp xterm-256color >/dev/null 2>&1; then export TERM=xterm-256color
fi
if tput setaf 1 &> /dev/null; then
tput sgr0
@shaunsantacruz
shaunsantacruz / jquery.pubsub.js
Created January 4, 2013 18:42
jQuery Tiny Pub/Sub
/* jQuery Tiny Pub/Sub */
(function($) {
var o = $({});
$.subscribe = function() {o.on.apply(o, arguments);};
$.unsubscribe = function() {o.off.apply(o, arguments);};
$.publish = function() {o.trigger.apply(o, arguments);};
}(jQuery));