Skip to content

Instantly share code, notes, and snippets.

View wayneeseguin's full-sized avatar
🤪

Wayne E Seguin wayneeseguin

🤪
View GitHub Profile
@wayneeseguin
wayneeseguin / gist:959068
Created May 6, 2011 14:48 — forked from iande/gist:959065
First Stab @ package_error
package_error()
{
local _message=$1
if [[ -z "${_message}" ]]
then
fail "Cannot print a package error as no message was provided."
fi
local _log=$2
@wayneeseguin
wayneeseguin / test.sh
Created May 5, 2011 14:36
Bash live update
#!/bin/bash
update()
{
echo "Before the update"
cat update > test.sh
echo "This has changed"
}
update
@wayneeseguin
wayneeseguin / editor.sh
Created April 27, 2011 12:18 — forked from drnic/editor.sh
Dr. Nic's wild and wonderous dotfiles editor setup
#
# Function definitions
#
use_textmate ()
{
# Clean redcar from path the easy way.
export PATH="$(printf "$PATH" | sed -e "s#${projects_path}/ruby_apps/redcar/bin##g")"
export EDITOR="/usr/local/bin/mate -w"
export GEM_OPEN_EDITOR="/usr/local/bin/mate"
alias tm_dialog="$HOME/Library/Application\ Support/TextMate/PlugIns/Dialog.tmplugin/Contents/Resources/tm_dialog"
function git_rev_head
{
# Can declare multiple variables on one line IFS separated.
# By default IFS is "white characters"
local rev_prompt_token=" » " rev=1 sym=0 sym_prompt="" rev_prompt="" \
colors=() branches=()
# If git branches contain whitespace, then the following should be quoted.
branches[$rev]="$(git name-rev --name-only head 2> /dev/null)"
branches[$sym]="$(git symbolic-ref -q head 2> /dev/null)"
# take 2
export PS1="\D{%H:%M:%S} \[\033[37m\]\u@\h\[\033[32m\]:\w \$( git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\\033[36m(\1)/' -e 's/(production)/\\033[1;37m\\033[41m(production)\\033[m/' -e 's/(master)/\\033[1;37m\\033[41m(master)\\033[m/' -e 's/(stage)/\\033[31m(stage)/' -e 's/(next)/\\033[33m(next)/')\[\033[37m\]\[\033[0m\] \n∫ "
# ALARM: production/master RED: stage YELLOW: next CYAN: everybody else
export PS1="\D{%H:%M:%S} \[\033[37m\]\u@\h\[\033[32m\]:\w \$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\\033[36m(\1)/' | sed -e 's/(production)/\\033[1;37m\\033[41m(production)\\033[m/' | sed -e 's/(master)/\\033[1;37m\\033[41m(master)\\033[m/' | sed -e 's/(stage)/\\033[31m(stage)/' | sed -e 's/(next)/\\033[33m(next)/')\[\033[37m\]\[\033[0m\] \n∫ "
@wayneeseguin
wayneeseguin / .zshrc
Created March 3, 2011 14:01 — forked from nclark/.zshrc
if [[ ( -a .rvmrc ) && $TERM == 'screen' ]]; then
source .rvmrc
fi
default_run_options[:pty] = true
set :application, "bobo"
set :repository, "file:///home/poporoot/git/bobo.git"
set :local_repository, "ssh://poporoot@192.168.56.158/home/poporoot/git/bobo.git"
set :user, 'poporoot'
set :deploy_to, "/home/poporoot/roboczy/bobo"
require 'bundler/capistrano'
#Shouldn't that be more this?
# curl https://github.com/wayneeseguin/rvm/raw/master/scripts/install | grep -v '^#'
set -o errtrace
export PS4='+[${BASH_SOURCE}] : ${LINENO} : ${FUNCNAME[0]:+${FUNCNAME[0]}() $ }'
if [[ -z "$rvm_selfcontained" ]]; then
if [[ $(id | sed -e 's/(.*//' | awk -F= '{print $2}') -eq 0 || \
@wayneeseguin
wayneeseguin / bashrc
Created November 23, 2010 20:38 — forked from orlandolopez/bashrc
# System-wide .bashrc file for interactive bash(1) shells.
if [ -z "$PS1" ]; then
: # no-op
fi
PS1='\h:\W \u\$ '
# Make bash check its window size after a process completes
shopt -s checkwinsize
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.