Skip to content

Instantly share code, notes, and snippets.

View nickwhitt's full-sized avatar

Nick Whitt nickwhitt

  • Columbus, Ohio, USA
  • 11:05 (UTC -04:00)
View GitHub Profile
@nickwhitt
nickwhitt / prompt.sh
Last active December 18, 2015 10:48 — forked from tobiassjosten/prompt.sh
#export PS1="\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ "
# Configure colors, if available.
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
c_reset='\[\e[0m\]'
c_user='\[\e[1;32m\]'
c_path='\[\e[1;34m\]'
c_git_clean='\[\e[0;37m\]'
c_git_staged='\[\e[0;32m\]'
c_git_unstaged='\[\e[0;31m\]'
@nickwhitt
nickwhitt / gist:5617325
Created May 21, 2013 03:34
PHP CLI Aliases With MAMP

Assumes MAMP was installed to default location: /Applications/MAMP.

PHP v5.2.17

$> ln -s /Applications/MAMP/bin/php/php5.2.17/bin/php /usr/local/bin/php52
$> php52 -v
PHP 5.2.17 (cli) (built: Jan 21 2013 14:44:43)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies

with eAccelerator v1.0-dev, Copyright (c) 2004-2012 eAccelerator, by eAccelerator

@nickwhitt
nickwhitt / rbenv.md
Last active December 15, 2015 15:19

Install rbenv and ruby-build with homebrew

$> brew install rbenv ruby-build

Install ruby 1.9.3 and declare global default

$> rbenv install 1.9.3-p392
$> rbenv global 1.9.3-p392
$> gem install rails

$> rails new proj-1.9.3

@nickwhitt
nickwhitt / gist:4947982
Last active December 13, 2015 17:28
Global Configuration
[alias]
st = status
ci = commit
br = branch
co = checkout
df = diff
lg = log -p
[color]
ui = true
[push]
@nickwhitt
nickwhitt / .gitconfig
Created February 13, 2013 20:30
Global Configuration
[user]
name = Your Name
email = your.name@somewhere.com
[core]
excludesfile = /path/to/.gitignore
[alias]
last = log -1 HEAD --stat
info = !cat .git/config
@nickwhitt
nickwhitt / 1.Setup.md
Created November 2, 2012 13:22
Capistrano

Development Machine

Install Capistrano with Railsless Deploy

$> sudo gem install capistrano railsless-deploy

Copy ssh keys to production

$> scp ~/.ssh/id_rsa.pub production:/tmp/id_rsa.developer.pub
@nickwhitt
nickwhitt / gist:3853635
Created October 8, 2012 17:04
Bash Shell

Install Bash/Completion Ports

$> sudo port selfupdate
$> sudo port install bash [bash-completion]

Change Shell

$> sudo bash -c "echo /opt/local/bin/bash >> /private/etc/shells"
$> chsh -s /opt/local/bin/bash

Verify

$> echo $SHELL

@nickwhitt
nickwhitt / Chef-Server.md
Created October 7, 2012 20:17
Chef Setup

Add the Opscode APT repository

$> echo "deb http://apt.opscode.com/ `lsb_release -cs`-0.10 main" | sudo tee /etc/apt/sources.list.d/opscode.list

Add the GPG key

$> sudo mkdir -p /etc/apt/trusted.gpg.d
$> gpg --keyserver keys.gnupg.net --recv-keys 83EF826A
$> gpg --export packages@opscode.com | sudo tee /etc/apt/trusted.gpg.d/opscode-keyring.gpg > /dev/null
$> sudo apt-get update
$> sudo apt-get install opscode-keyring
@nickwhitt
nickwhitt / gist:3006246
Created June 27, 2012 19:28
Tar and Compress
tar.bz2
compress: tar -jcvf archive_name.tar.bz2 directory_to_compress
extract: tar -jxvf archive_name.tar.bz2 [-C /tmp/extract_here/]
tar.gz
compress: tar -zcvf archive_name.tar.gz directory_to_compress
extract: tar -zxvf archive_name.tar.gz [-C /tmp/extract_here/]
@nickwhitt
nickwhitt / gist:2924285
Created June 13, 2012 14:06
jQuery Ready Equivalence
$(function() {
// Handler for .ready() called.
});
is equivalent to:
$(document).ready(function() {
// Handler for .ready() called.
});