Skip to content

Instantly share code, notes, and snippets.

@masugadesign
masugadesign / .bash_profile prompt (remote server, Git branch)
Created February 15, 2010 17:49
.bash_profile prompt (remote server, Git branch)
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
# non git dir: [email protected]:~/var/www: _
# in git dir: [email protected]:~/var/www/site.tld (branchname): _
PS1="\[\e[01;31m\]\u@\H:\w\$(parse_git_branch): \[\e[00m\]"
# !/bin/bash
# Set up an new github repository
GITHUB_USERNAME="timkelty"
# from github instructions page after creating a repo
mkdir "$1"
cd "$1"
git init
touch README
@masugadesign
masugadesign / force or remove www
Created May 13, 2009 00:45
htaccess rules to force or remove www
# Remove the www
# RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
# RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
# Force the www
# RewriteCond %{HTTP_HOST} !^www\.
# RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
# Run this at your site root to upgrade EE
# Paths assume your system folder is at site root
# http://expressionengine.com/docs/installation/update.html
#!/bin/bash
# location of the release
RELEASE_PATH="/Users/ryan/Desktop/Incoming/ExpressionEngine1.6.7"
echo "Enter the name of your system folder"