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
class John | |
def like_your_work | |
puts 'I like your work' | |
end | |
def x_your_face x | |
puts "I'll #{x} your face" | |
end | |
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
require 'freeagent_api' | |
include Freeagent | |
Freeagent.authenticate({ | |
:domain => 'tthuk.freeagentcentral.com', | |
:username => '[email protected]', | |
:password => 'NotMyRealPassword'}) | |
Contact.new({ :first_name => 'Tom', | |
:last_name => 'Hall', |
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
configure do | |
set :haml, { :attr_wrapper => '"', :format => :html5 } | |
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
puts "I have PID #{Process.pid}" | |
Signal.trap("USR1") {puts "prodded me"} | |
loop do | |
begin | |
puts "doing stuff" | |
sleep 10 | |
rescue Exception => e | |
puts e.inspect |
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
start on runlevel [2345] | |
stop on runlevel [06] | |
respawn | |
expect fork | |
script | |
export HOME="/home/deploy" | |
export JAVA_HOME="/usr/lib/jvm/java-6-sun" | |
export HIVE_HOME="/usr/lib/hive" |
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 method_in_deploy | |
puts "METHOD IN DEPLOY" | |
end | |
task :task_in_deploy do | |
puts "TASK IN DEPLOY" | |
end | |
task :do_before do | |
puts "BEFORE" |
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
Tom-Halls-MacBook-Pro:hen-night-hq-facebook-app tomh$ cap deploy | |
METHOD IN DEPLOY | |
* executing `task_in_deploy' | |
TASK IN DEPLOY | |
* executing `deploy' | |
triggering before callbacks for `deploy' | |
* executing `do_before' | |
BEFORE | |
* executing `deploy:update' | |
** transaction: start |
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
require 'fog' | |
ELB = Fog::AWS::ELB.new | |
COMPUTE = Fog::Compute.new( :provider => 'AWS') | |
def server_from_dns_name dns_name | |
COMPUTE.servers.all.find {|server| server.dns_name == dns_name} | |
end | |
def id_from_dns_name dns_name |
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
description "nginx http daemon" | |
start on runlevel [2345] | |
stop on runlevel [!2345] | |
exec /opt/nginx/sbin/nginx -g "daemon off;" | |
respawn |
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
limit nofile 20000 20000 | |
kill timeout 300 | |
env MONGO_DATA=/var/lib/mongodb/ | |
env MONGO_LOGS=/var/log/mongodb/ | |
env MONGO_EXE=/usr/bin/mongod | |
env MONGO_CONF=/etc/mongodb.conf | |
pre-start script |