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
# config/deploy/production.rb | |
# okay, this is to make sure I don't miss another deploy. | |
def abort_deploy | |
puts "Deploy aborted." | |
exit 1 | |
end | |
unless `git show-ref heads/stable`.split[0] == `git show-ref heads/master`.split[0] |
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
$ time bundle exec cucumber features/admin/authentication.feature | |
MID-2007 15-INCH MACBOOK PRO | |
2.2 GHz Core 2 Duo 6GB 320GB 7200rpm HD | |
# Hot | |
startup 24.7s | |
total 28.4s | |
# Cold | |
startup 38.3s | |
total 43.3s |
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
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA1VmCogSSRe2/OWkNI1Be5IxLcr5iX2hlArqCqHPXqzqLP9DQeU93g1Ml0HpdLq2FRqIbWNDLMmULu9zzFqAQIqPfqwonLqjnH3TiiUv0gh9Dg+ePFkGU7FYGtD3EEvFoZEmlEoZC61HLYY0AcItDM2mRVWi4gWw9nJm7E0iZYUylaLxpQVxFDuqWg6CCgHj6GxMQ8IoQp5feuPCe9a70B9w8zqhhNOlKfIddxx2pcBU2gjHyVfslWr4WuRziuZ3nHmnleCawirLi4GyoWhEsGeKw0pDRfazZyVmLgOSF3gB1qxJddFmRHYZ6a9s4oMOdxf54C6j7hb9dKvoihMde2Q== [email protected] |
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
#!/usr/bin/env ruby | |
require 'fileutils' | |
if ARGV.size < 3 | |
puts <<-USAGE | |
mass_rename [file1 file2 ...] <regexp> <replacement> | |
USAGE | |
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
# by default you only get 1000 objects at a time | |
# so you have to roll your own cursor | |
S3.connect! | |
objects = [] | |
last_key = nil | |
begin | |
new_objects = AWS::S3::Bucket.objects(bucket_name, :marker => last_key) | |
objects += new_objects |
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
#!/usr/bin/env ruby | |
require 'benchmark' | |
if ARGV[0] | |
ENV['RAILS_ENV'] = %w{development test production staging}.find { |e| e[0] == ARGV[0][0] } || ARGV[0] | |
else | |
ENV['RAILS_ENV'] ='test' | |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
# auto-install pivotal-tracker gem if not present | |
if Gem::Specification.find_all_by_name('pivotal-tracker').empty? | |
puts 'Installing pivotal-tracker gem...' | |
puts `gem install pivotal-tracker --no-ri --no-rdoc` | |
Gem.refresh | |
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
#!/usr/bin/env bash | |
# from http://ihswebdesign.com/knowledge-base/installing-a-patched-ruby-192-for-faster-rails-startup/ | |
echo "Downloading require performance patch from Stefan Kaes' rvm-patchsets repository..." | |
curl https://raw.github.com/skaes/rvm-patchsets/671f0e4e6487af7a252d86b59d645ee7beb849dd/patches/ruby/1.9.2/p290/railsexpress/05-load-performance-fix.patch > 1.9.2-p290_require_speedup.patch | |
echo "Installing ruby-1.9.2-p290-patched..." | |
rvm install 1.9.2-p290 --patch 1.9.2-p290_require_speedup.patch -n patched |
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 User | |
include MongoMapper::Document | |
def profile | |
person.profile | |
end | |
one :person, :class_name => 'Person', :foreign_key => :owner_id | |
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
$ gem list | |
*** LOCAL GEMS *** | |
activemodel (3.0.4) | |
activesupport (3.0.4) | |
ansi (1.2.2) | |
bson (1.2.4) | |
bson_ext (1.2.3) | |
builder (2.1.2) |