This file contains 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
before do | |
cache_control :public, :max_age => 31557600 | |
end | |
get '/' do | |
send_file(File.join(settings.public, 'index.html'), :disposition => nil) | |
end | |
get '/*' do | |
send_file(File.join(settings.public, params[:splat]), :disposition => nil) |
This file contains 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
# Better to treat them as binary files. | |
*.pbxproj -crlf -diff -merge | |
*.pbxuser -crlf -diff -merge | |
*.xib -crlf -diff -merge |
This file contains 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
set :thin_conf, "#{current_path}/config/thin_cluster.yml" | |
namespace :deploy do | |
%w(star stop restar).each do |action| | |
task action.to_sym, :roles => :app do | |
run "thin -c #{deploy_to}/current -C #{thin_conf} #{action}" | |
end | |
end | |
end |
This file contains 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 'vendor/gems/environment' | |
Bundler.require_env |
This file contains 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
rails_root = "/data/github/current" | |
20.times do |num| | |
God.watch do |w| | |
w.dir = rails_root | |
w.env = {'RAILS_ENV' => 'production'} | |
w.name = "dj-#{num}" | |
w.group = 'dj' | |
w.interval = 30.seconds |
This file contains 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
curl -d "payload=testinggithubservicehooks" \ | |
http://www.google.com/webmasters/tools/ping?sitemap=http%3A%2F%2Fwww.example.com%2Fsitemap.xml |
This file contains 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
# Drop it in config/deploy/ | |
# | |
# It's evaluated inside the deploy resource's context. | |
# | |
# It assumes Gemfile and Gemfile.lock are present and satisfy Bundler's | |
# requirements for the --deployment option. | |
current_release_directory = release_path | |
running_deploy_user = new_resource.user | |
bundler_depot = new_resource.shared_path + '/bundle' |
This file contains 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
Scenario: Deleting a user | |
When I go to the users page | |
And follow "Delete" for the 2nd user | |
Then I should be on the users page | |
And should not see "user2" |
This file contains 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
# Adding a host record. | |
sudo dscl . -create /Hosts/www.example.com ip_address 10.1.2.3 | |
# Removing that same host record. | |
sudo dscl . -delete /Hosts/www.example.com |
This file contains 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 'active_support/time' | |
bucket = AWS.directories.select {|d| d.key == 'my_bucket'} | |
files = bucket.files.select {|f| f.content_length > 0 && | |
f.key =~ %r{client-name.*\.zip}} | |
expiration = Time.now.next_month.end_of_month | |
signed_urls = files.map {|f| f.url(expiration)} | |
fixed_signed_url = signed_urls.map do |su| | |
su.sub(%r{s3\.(.*)/my_bucket}, "my_bucket.s3.#{$1}") | |
end |
OlderNewer