Skip to content

Instantly share code, notes, and snippets.

View JangoSteve's full-sized avatar

Steve Schwartz JangoSteve

View GitHub Profile
@JangoSteve
JangoSteve / thread_safe_block_depth.rb
Created October 25, 2010 21:29
A way to track the current block level for instance block-methods, which is completely thread-safe
class MyObject
def block_depth=(value)
Thread.current[:block_depth] = value
end
def block_depth
Thread.current[:block_depth] || 0
end
@JangoSteve
JangoSteve / ubuntu_rails_install.rb
Created January 22, 2011 17:58
Capistrano script to install Ruby, RVM, Rails in ubuntu (modified from deploy.rb scripts)
namespace :ubuntu do
desc "Setup Environment"
task :setup_env, :roles => :app do
update_apt_get
install_dev_tools
install_git
install_subversion
install_sqlite3
# Install and setup RVM instead of old Rails stack
#install_rails_stack
@JangoSteve
JangoSteve / Terminal Saved Output.txt
Created November 1, 2011 15:23
Mac Setup - pivotal_workspace soloist - Terminal Output
Last login: Tue Nov 1 04:20:56 on console
steves-macbook:~ steveschwartz$ cd ~/workspace/
steves-macbook:workspace steveschwartz$ soloist
running chef: sudo bash -c 'PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin chef-solo -j /var/folders/f9/f99vsO5cHRCsJ+7Fb+UNhE+++TI/-Tmp-/soloist20111101-253-1kys0lq-0 -c /var/folders/f9/f99vsO5cHRCsJ+7Fb+UNhE+++TI/-Tmp-/soloist20111101-253-1r2g8qc-0 -l info'
Password:
[Tue, 01 Nov 2011 05:02:33 -0400] INFO: *** Chef 0.10.4 ***
[Tue, 01 Nov 2011 05:02:37 -0400] INFO: Setting the run_list to ["pivotal_workstation::bash_profile-arch_flags", "pivotal_workstation::meta_osx_base", "pivotal_workstation::meta_osx_development", "pivotal_workstation::meta_ruby_development", "pivotal_workstation::mongodb", "pivotal_workstation::pg_admin", "pivotal_workstation::solr", "pivotal_workstation::ssl_certificate"] from JSON
[Tue, 01 Nov 2011 05:02:37 -0400] INFO: Run List is [recipe[pivotal_workstation::bash_profile-arch_flags], recipe[pivotal_workstation::meta_osx_base], re
@JangoSteve
JangoSteve / soloistrc
Created November 1, 2011 15:25
Mac Setup - soloistrc
cookbook_paths:
- /Users/steveschwartz/workspace
recipes:
- pivotal_workstation::bash_profile-arch_flags # ONLY USE IF YOU ARE ON SNOW LEOPARD
- pivotal_workstation::meta_osx_base
- pivotal_workstation::meta_osx_development
- pivotal_workstation::meta_ruby_development
- pivotal_workstation::mongodb
- pivotal_workstation::pg_admin
- pivotal_workstation::solr
@JangoSteve
JangoSteve / git.sh
Created November 2, 2011 05:08
git aliases for bash profile - ~/.bash_profile_includes/git.sh
alias gco="git checkout"
alias gst="git status"
alias gcm="git commit -m"
alias gca="git commit --amend"
alias gpr="git pull --rebase"
alias gpl="git pull"
alias gpu="git push"
alias gri="git rebase -i"
alias gre="git rebase"
alias gad="git add"
@JangoSteve
JangoSteve / bundle.sh
Created November 2, 2011 05:09
bundle aliases for bash profile - ~/.bash_profile_includes/bundle.sh
alias be="bundle exec"
alias bi="bundle install"
alias bu="bundle update"
@JangoSteve
JangoSteve / rails.sh
Created November 2, 2011 06:41
rails aliases for bash profile - ~/.bash_profile_includes/rails.sh
alias rs="rails s"
alias rc="rails c"
alias ber="bundle exec rspec"
@JangoSteve
JangoSteve / .gvimrc.local
Created November 2, 2011 06:45
macvim local customizations - ~/.gvimrc.local
color jellybeans+
let NERDTreeDirArrows = 1
let NERDTreeMouseMode = 1
" <Ctrl-l> redraws the screen and removes any search highlighting.
nnoremap <silent> <C-l> :nohl<CR><C-l>
@JangoSteve
JangoSteve / .janus.rake
Created November 2, 2011 06:46
local customized macvim janus raketask - ~/.janus.rake
skip_vim_plugin "nerdtree"
vim_plugin_task "nerdtree-scrooloose", "git://github.com/scrooloose/nerdtree.git"
@JangoSteve
JangoSteve / gist:1340366
Created November 4, 2011 20:12
Installing gems with native extensions
# Installing ruby-debug19 with ruby-1.9.3
gem install ruby-debug19 -- --with-ruby-include="$rvm_path/src/$(rvm tools identifier)/"