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
module ActiveRecord | |
module ConnectionAdapters | |
module DatabaseStatements | |
# | |
# Run the normal transaction method; when it's done, check to see if there | |
# is exactly one open transaction. If so, that's the transactional | |
# fixtures transaction; from the model's standpoint, the completed | |
# transaction is the real deal. Send commit callbacks to models. | |
# | |
# If the transaction block raises a Rollback, we need to know, so we don't |
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
#!/usr/bin/env bash | |
if [ "x$1" == 'xoff' ] | |
then | |
$0 turn off | |
sleep 1 | |
say yes | |
else | |
say X box $* | |
fi |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>CFBundleDevelopmentRegion</key> | |
<string>English</string> | |
<key>CFBundleDocumentTypes</key> | |
<array> | |
<dict> | |
<key>CFBundleTypeRole</key> |
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
select @session := COALESCE(max(session), 0) + 1 from product_invalidations; | |
insert product_invalidations(product_id, session) select p.id, @session from products p inner join product_types pt on pt.id = p.product_type_id where pt.name = 'mobile-phones'; |
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
data = Hash.new(0) | |
while line = gets | |
if m = line.match(/Rendered (\S+) \(([\d\.]+)\)/) | |
data[m[1]] += m[2].to_f | |
end | |
if line =~ /Completed/ | |
data.sort_by{ |name, value| value }.each do |name, value| | |
puts "%.04f : #{name}" % value |
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
#!/usr/bin/env ruby | |
require "rubygems" | |
gem "beanstalk-client" | |
require "beanstalk-client" | |
port = ARGV.last or raise "GIVE ME A PORT NEXT TIME!" | |
beanstalk = Beanstalk::Pool.new(["0.0.0.0:#{port}"]) | |
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 'drb' | |
module RemoteRunner | |
module Runner | |
def eval(code) | |
Kernel.eval(code) | |
end | |
end | |
def load_app(app) |
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
# t(:foo) now looks for admin.blog_controller.foo, then if not found it then goes for admin.foo, then finally just foo. | |
def ApplicationController.has_controler_specific_translation_helper_fu | |
def t(key, options = {}) | |
controller_name = self.controller_name + "_controller" | |
defaults = [[:admin, controller_name, key], [:admin, key], [key]].map{|a| a.join(".").to_sym} | |
key, defaults = *defaults | |
options[:default] = defaults | |
I18n.t(key, options) | |
end | |
helper_method :t |
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
#!/usr/bin/env ruby | |
gem 'mbleigh-ruby-github' | |
require "ruby-github" | |
unless username = ARGV.first and username =~ /[a-zA-Z0-9]+/ | |
puts "Usage: #{$0} <github_username>" | |
exit(1) | |
end | |
BASE_PATH=File.expand_path("./repos") |
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
namespace :deployment do | |
desc "Mark the deployment as locked, preventing further deployments (until deployment:unlock)" | |
task :lock, :roles => :app do | |
run "touch -f #{shared_path}/locked" | |
end | |
desc "Unmark the deployment as locked, allowing further deployments (until deployment:lock)" | |
task :unlock, :roles => :app do | |
run "rm #{shared_path}/locked" | |
end |
OlderNewer