Skip to content

Instantly share code, notes, and snippets.

module Autotest::Growl
def self.growl title, msg, img, pri=0, stick=""
system "growlnotify -n autotest --image #{img} -p #{pri} -m #{msg.inspect} #{title} #{stick}"
end
def self.strip_command_line_format(text)
result = text.gsub(/\e\[(\d+)m/,"")
result.gsub!("\n","")
end
# Use a covering technique to cover first blacks, then whites
# At each step, anything covered is acccounted for.
# Anything uncovered at the end is just plain wrong
def guess(guess)
covered_result = @secret_code.dup
guess.each_with_index do |color, i|
covered_result[i] = 'b' if @secret_code[i] == color
end
guess.each_with_index do |color, i|
git clone git@github.com:inventables/fbolt.git fbolt_empty_dir_test
Initialized empty Git repository in /Users/Jtalbot/projects/fbolt_empty_dir_test/.git/
remote: Counting objects: 22633, done.
remote: Compressing objects: 100% (8220/8220), done.
remote: Total 22633 (delta 13742), reused 22438 (delta 13619)
Receiving objects: 100% (22633/22633), 29.35 MiB | 339 KiB/s, done.
Resolving deltas: 100% (13742/13742), done.
Jtalbot@mac ~/projects> cd fbolt_empty_dir_test/
Jtalbot@mac ~/projects/fbolt_empty_dir_test> ls -la vendor/plugins/thinking-sphinx/
total 0
......................................................................................................................................................ignoring attempt to close div with noscript
opened at byte 1851, line 79
closed at byte 3300, line 108
attributes at open: {"id"=>"sidebar"}
text around open: " </div>\n </div>\n\n <div id=\"sidebar\">\n "
text around close: " </form>\n </noscript>\n \n "
.ignoring attempt to close div with noscript
opened at byte 1746, line 76
closed at byte 3195, line 105
attributes at open: {"id"=>"sidebar"}
# Load the adwords hierarchy, because the gem doesn't
module AdWords
module V13
module TrafficEstimatorService
class KeywordRequest
end
end
end
end
db = rds.create_db_instance(
:db_instance_identifier => "[FILTERED]",
:allocated_storage => 100,
:db_instance_class => "db.m1.small",
:engine => "MySQL5.1",
:master_username => '[FILTERED]',
:master_user_password => '[FILTERED]',
:db_name => '[FILTERED]',
:availability_zone => 'us-east-1c'
)
db.authorize_db_security_group(:db_security_group_name => 'default', :ec2_security_group_name => '[our-ec2-security-group]', :ec2_security_group_owner_id => '[our-aws-account-number]')
db = rds.create_db_instance(:db_instance_identifier => "[FILTERED]", :allocated_storage => 100, :db_instance_class => "db.m1.small", :engine => "MySQL5.1", :master_username => '[FILTERED]', :master_user_password => '[FILTERED]', :db_name => '[FILTERED]', :availability_zone => 'us-east-1c')
> mysqldump old_db -u user -p > inventables.sql
> mysql rds_db -u user -p -h [RDS_connection_string] < inventables.sql
rds.create_db_snapshot(
:db_snapshot_identifier => 'test-snap',
:db_instance_identifier => '[production-instance]'
)
rds.restore_db_instance_from_snapshot(
:db_snapshot_identifier => 'test-snap',
:db_instance_identifier => 'clone',
:db_instance_class => 'db.m1.small'
)