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
1 class Object | |
2 # Returns a hash where the key is a message that this object | |
3 # responds to and the value is the first object that responded | |
4 # to that message. | |
5 def first_responders | |
6 methods_hash = {} | |
7 self.class.instance_methods.each {|m| methods_hash[m] = self} | |
8 self.class.ancestors.each do |ancestor| | |
9 ancestor.instance_methods.each {|m| methods_hash[m] = ancestor} | |
10 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
def foo=(bar) | |
puts "in foo=" | |
bar*1.5 | |
end | |
def original_code | |
puts "The original quiz code sets a local var, and does not call the method" | |
puts("return val: #{foo = 8}") | |
puts("local variables: " + local_variables.inspect) | |
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
source :gemcutter | |
source Bundler::Source::GemCache.new("path" => File.expand_path("../vendor/plugins/utils/local_gems", __FILE__)) | |
gem "rails", "2.3.4" | |
gem "rake", "0.8.7" | |
gem "mysql", "2.8.1" | |
# Required gems | |
################### couchrest ########## | |
# new versions of rest-client break couchrest |
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
# An example config deploy file using the Accurev SCM integration. The Accurev | |
# integration uses the Accurev CLI tool, so that needs to be installed and | |
# configured on the machines that are running Accurev commands. | |
# | |
# For illustrative purposes, we will assume we have a depot called my_depot. | |
# The root stream, my_depot, is what should be in production. There is a stream hanging off | |
# the root, my_depot-staging, which is holds what should be in the staging environment. | |
set :scm, :accurev | |
set :repository, 'my_depot' |
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
-bash: /Users/doug/.rvm/scripts/utility: line 457: syntax error near unexpected token `(' | |
-bash: /Users/doug/.rvm/scripts/utility: line 457: ` \rm -rf "${rvm_tmp_path}/$1"*(N) >/dev/null 2>&1' | |
-bash: __rvm_conditionally_add_bin_path: command not found |
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
EM.run do | |
channel = AQMP::Channel.new | |
# Allow 10 unacked messages to be delivered to this worker. | |
channel.prefetch(10) | |
# Configure this worker to send at 1 msg/s on average with occassional bursts | |
# up to 5 messages. | |
token_bucket = TokenBucket.new(1, 5) |
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
### Keybase proof | |
I hereby claim: | |
* I am dougbarth on github. | |
* I am dougbarth (https://keybase.io/dougbarth) on keybase. | |
* I have a public key whose fingerprint is E311 A6FA 87A5 A5B1 8548 B2E2 F147 4600 851F 4F13 | |
To claim this, I am signing this object: |
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
xtrabackup: Creating suspend file '/tmp/xtrabackup_suspended_2' with pid '6701' | |
>> log scanned up to (3225206169821) | |
140605 22:34:43 innobackupex: Continuing after ibbackup has suspended | |
140605 22:34:43 innobackupex: Starting to lock all tables... | |
>> log scanned up to (3225206203261) | |
>> log scanned up to (3225206235126) | |
>> log scanned up to (3225206235221) | |
>> log scanned up to (3225206235221) | |
>> log scanned up to (3225206235221) |
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
begin | |
require 'bundler/inline' | |
rescue LoadError => e | |
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler' | |
raise e | |
end | |
gemfile(true) do | |
source 'https://rubygems.org' | |
gem 'rails', github: 'rails/rails' |
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 'rubygems' | |
require 'jsonlint' | |
puts "=== Ruby version: #{RUBY_VERSION}" | |
puts "=== gem env" | |
system("gem env") | |
puts "=== Load Path" | |
puts $: | |
puts "=== Loaded features" | |
puts $LOADED_FEATURES |
OlderNewer