Mountain Lion (10.8) has three main difference compared to Lion (10.7):
- XCode 4.4 does not install Command Line Tools by default
- X11 isn't available anymore
- The installed version of OpenSSL has some bugs
# collect information about a running process | |
# ruby debug.rb <pid> | |
begin | |
raise ArgumentError unless pid = ARGV[0] | |
pid = pid.to_i | |
raise ArgumentError unless pid > 0 | |
Process.kill(0,pid) | |
rescue TypeError, ArgumentError | |
raise 'pid required' |
require 'dalton/strategies/skroutz' | |
require 'dalton/strategies/facebook' | |
require 'dalton/strategies/openid' # yahoo, #google | |
require 'dalton/strategies/twitter' | |
# Setup OpenId file storage, don't change the storage engine! | |
require 'openid/store/filesystem' | |
Rails.configuration.middleware.use(Rack::OpenID, | |
OpenID::Store::Filesystem.new(Rails.root + 'tmp/openid')) |
#!/usr/bin/env ruby | |
# Copy path from rspect stack trace and execute it | |
# spm ./spec/models/space_spec.rb:867 | |
path = ARGV[0] | |
file, number, _ = path.split ':' | |
number = number.to_i | |
line = number > 0 ? " -l #{number}" : "" |
require 'socket' | |
socket = UDPSocket.new | |
socket.send("I am ok.", 0, 'localhost', 1234) | |
text, sender = socket.recvfrom(16) | |
socket.close |
Rails flash messages with AJAX requests
rsync (Everyone seems to like -z, but it is much slower for me)
Below are the actual files we use in one of our latest production applications at Agora Games to achieve zero downtime deploys with unicorn. You've probably already read the GitHub blog post on Unicorn and would like to try zero downtime deploys for your application. I hope these files and notes help. I am happy to update these files or these notes if there are comments/questions. YMMV (of course).
Other application notes:
Salient points for each file:
file_to_disk = './tmp/large_disk.vdi' | |
Vagrant::Config.run do |config| | |
config.vm.box = 'base' | |
config.vm.customize ['createhd', '--filename', file_to_disk, '--size', 500 * 1024] | |
config.vm.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk] | |
end |
guard :rspec, cmd: 'zeus rspec --color' do | |
watch(%r{^spec/.+_spec\.rb$}) | |
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } | |
watch('spec/spec_helper.rb') { "spec" } | |
# Rails example | |
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } | |
watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" } | |
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] } | |
watch(%r{^spec/support/(.+)\.rb$}) { "spec" } |