Skip to content

Instantly share code, notes, and snippets.

View phudgins's full-sized avatar

Pete Hudgins phudgins

  • Dominion Enterprises
  • Norfolk, VA
View GitHub Profile
@phudgins
phudgins / resful_vs_non_restful_communication.md
Created April 25, 2014 13:15
Restful vs Non Restful communication

Non Restful

Client: Create a widget with a price of $2.00.

Server: OK.

Client: It worked! Great! Get me the widget I just created.

Server: OK.

@phudgins
phudgins / scala_install.bash
Created January 17, 2014 15:51
Install scala, sbt and play
# Scala
mv ~/Desktop/scala-2.10.2 /usr/local
ln -s /usr/local/scala-2.10.2 /usr/local/share/scala
export SCALA_HOME=/usr/local/share/scala
export PATH=/usr/local/bin:$PATH:/usr/bin:/bin:/usr/sbin:/sbin:$SCALA_HOME/bin
# sbt
mv ~/Desktop/sbt /usr/local
ln -s /usr/local/sbt /usr/local/share/sbt
export SBT_HOME=/usr/local/share/sbt
@phudgins
phudgins / stacktrace.txt
Created October 16, 2013 12:55
Stacktrace from zeus with rbenv and rbenv-bundler
/Users/pete/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:33:in `block in setup': You have already activated json 1.8.0, but your Gemfile requires json 1.7.7. Using bundle exec may solve this. (Gem::LoadError)
from /Users/pete/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:19:in `setup'
from /Users/pete/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler.rb:120:in `setup'
from /Users/pete/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/setup.rb:7:in `<top (required)>'
from /Users/pete/.rbenv/versions/2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:133:in `require'
from /Users/pete/.rbenv/versions/2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:133:in `rescue in require'
from /Users/pete/.rbenv/versions/2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:142
@phudgins
phudgins / update_postgresql.sh
Last active December 23, 2015 12:49
Mac Homebrew upgrade postgres from 9.2.4 to 9.3.0
# Unload the launch_ctl (stop the server)
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
# Move the data directory
mv /usr/local/var/postgres /usr/local/var/postgres92
# Upgrade postgresql
brew update && brew upgrade postgresql
# Init the new database cluster
@phudgins
phudgins / daemon_unicorn.sh
Created September 5, 2013 16:19
Common commands for stopping/starting daemonized unicorn
# To start unicorn and tail log
$ foreman start && tail -f log/unicorn.log
# To stop server
$ cat tmp/pids/unicorn.pid | xargs kill -9
@phudgins
phudgins / .tmux.conf
Created September 24, 2012 13:27
current tmux conf
# Use zsh
set-option -g default-shell /usr/bin/zsh
# It's 2012
set -g default-terminal "screen-256color"
# use v and s for windows splits
unbind %
bind s split-window -v
bind v split-window -h
@phudgins
phudgins / date_range.rb
Created April 25, 2012 18:13
Iterate through a Date Range
(30.days.ago.to_date..Date.today).each do |date|
puts date.to_s
end
@phudgins
phudgins / cleanout-rvm.sh
Created April 10, 2012 12:35
Remove RVM if rvm implode doesn't work
#!/bin/bash
/usr/bin/sudo rm -rf $HOME/.rvm $HOME/.rvmrc /etc/rvmrc /etc/profile.d/rvm.sh /usr/local/rvm /usr/local/bin/rvm
/usr/bin/sudo /usr/sbin/groupdel rvm
/bin/echo "RVM is removed. Please check all .bashrc|.bash_profile|.profile|.zshrc for RVM source lines and delete or comment out if this was a Per-User installation."
@phudgins
phudgins / .gitconfig
Created March 21, 2012 19:55
current .gitconfig
[user]
name = XXXX
email = XXXX
[color]
diff = auto
status = auto
branch = auto
[color "status"]
changed = yellow
added = green
@phudgins
phudgins / .zshrc
Created March 21, 2012 19:49
Current zshrc
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="afowler"
export EDITOR="vim"