This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# My pimped out unicorn config, with incremental killof | |
# and all the latest capistrano & bundler-proofing | |
# @jamiew :: http://github.com/jamiew | |
application = "000000book.com" | |
environment = ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'production' | |
app_path = "/srv/#{application}" | |
bundle_path = "#{app_path}/shared/bundle" | |
timeout 30 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// "color_scheme": "Packages/Color Scheme - Default/Monokai Bright.tmTheme", | |
"color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme", | |
"detect_indentation": true, | |
"ensure_newline_at_eof_on_save": true, | |
"find_selected_text": true, | |
//"font_face": "inconsolata", | |
//"font_face": "consolas", | |
//"font_face": "mensch", | |
"font_face": "monaco", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# For debugging use iptables -v. | |
IPTABLES="/sbin/iptables" | |
IP6TABLES="/sbin/ip6tables" | |
MODPROBE="/sbin/modprobe" | |
RMMOD="/sbin/rmmod" | |
ARP="/usr/sbin/arp" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run me with: | |
# | |
# $ watchr specs.watchr | |
# -------------------------------------------------- | |
# Convenience Methods | |
# -------------------------------------------------- | |
def all_spec_files | |
Dir['spec/**/*_spec.rb'] | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def tip(msg); puts; puts msg; puts "-"*100; end | |
# | |
# 30 Ruby 1.9 Tips, Tricks & Features: | |
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/ | |
# | |
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2" | |
tip "Ruby 1.9 supports named captures in regular expressions!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def call(*args, &block) | |
evaluate_method(method, *args, &block) if should_run_callback?(*args) | |
rescue LocalJumpError => e | |
puts method.inspect | |
puts args.inspect | |
puts e.backtrace.inspect | |
raise ArgumentError, | |
"Cannot yield from a Proc type filter. The Proc must take two " + | |
"arguments and execute #call on the second argument." | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActionView::Base.field_error_proc = Proc.new { |html_tag, instance| %[<span class="fieldWithError">#{html_tag}</span>] } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://unicorn.bogomips.org/SIGNALS.html | |
namespace :unicorn do | |
task :start, :roles => :app do | |
sudo "god start unicorn" | |
end | |
task :stop, :roles => :app do | |
sudo "god stop unicorn" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://unicorn.bogomips.org/SIGNALS.html | |
rails_env = ENV['RAILS_ENV'] || 'production' | |
rails_root = ENV['RAILS_ROOT'] || "/data/github/current" | |
God.watch do |w| | |
w.name = "unicorn" | |
w.interval = 30.seconds # default | |
# unicorn needs to be run from the rails root |