Skip to content

Instantly share code, notes, and snippets.

@oaltman
Created July 30, 2013 00:27
Show Gist options
  • Save oaltman/6109099 to your computer and use it in GitHub Desktop.
Save oaltman/6109099 to your computer and use it in GitHub Desktop.
Alias .
function .() {
set +o monitor
PORT=8888
ADDRESS='localhost'
BROWSER="chromium-browser"
[[ -n "$1" ]] && PORT=$1
[[ -n "$2" ]] && ADDRESS=$2
[[ -n "$3" ]] && BROWSER=$3
CURRENT=`pwd`
[[ ! -f "index.php" ]] && cd www
nohup php -S "$ADDRESS:$PORT" &
SERVER_PID=$!
echo $PID
cd $CURRENT
nohup $BROWSER --app="http://$ADDRESS:$PORT/?LR-verbose" &
BROWSER_PID=$!
echo $BROWSER_PID
[[ -f "Guardfile" ]] && guard start -c -i && read
[[ ! -f "Guardfile" ]] && read
kill -9 `pgrep -P $$`
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment