Skip to content

Instantly share code, notes, and snippets.

View Fluxx's full-sized avatar

Jeff Pollard Fluxx

View GitHub Profile
From 52f34f81e6c66e69eacbcd85979e6430dc903a3e Mon Sep 17 00:00:00 2001
From: Jeff Pollard <jeff.pollard@gmail.com>
Date: Wed, 12 Oct 2011 16:13:59 -0700
Subject: [PATCH] Fix 1.9 incompatabiliy with the riak cookbook
---
cookbooks/riak/libraries/riak_template_helper.rb | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/cookbooks/riak/libraries/riak_template_helper.rb b/cookbooks/riak/libraries/riak_template_helper.rb
From 52f34f81e6c66e69eacbcd85979e6430dc903a3e Mon Sep 17 00:00:00 2001
From: Jeff Pollard <jeff.pollard@gmail.com>
Date: Wed, 12 Oct 2011 16:13:59 -0700
Subject: [PATCH] Fix 1.9 incompatabiliy with the riak cookbook
---
cookbooks/riak/libraries/riak_template_helper.rb | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/cookbooks/riak/libraries/riak_template_helper.rb b/cookbooks/riak/libraries/riak_template_helper.rb
require "rspec"
class Array
def amap
return to_enum(:amap) unless block_given?
self.class.new.tap do |arr|
each { |i| arr << yield(i) }
end
=====
===== LOGGING STARTED Tue Oct 18 15:10:25 PDT 2011
=====
Exec: /usr/lib/riak/erts-5.7.5/bin/erlexec -boot /usr/lib/riak/releases/0.14.2/riak -embedded -config /etc/riak/app.config -args_file /etc/riak/vm.args -- console
Root: /usr/lib/riak
Erlang R13B04 (erts-5.7.5) [source] [64-bit] [smp:16:16] [rq:16] [async-threads:64] [kernel-poll:true]
** Found 0 name clashes in code paths
def traverse(node, &block)
return unless node
yield node
traverse(node.left, &block) if node.left
traverse(node.right, &block) if node.right
end
def identical?(tree_1, tree_2)
num_nodes = 0
@Fluxx
Fluxx / output.bash
Created November 16, 2011 06:46
Weird YAML delegator bug
jeff ~/Workspace/test $ cat test.rb
require 'delegate'
require 'yaml'
class A < DelegateClass(Array)
def initialize(*args)
super(Array.new(*args))
end
end
@Fluxx
Fluxx / poc.rb
Created February 14, 2012 00:18
require "rubygems"
require "capybara"
require 'capybara/poltergeist'
session = Capybara::Session.new(:poltergeist)
session.visit('http://www.disqus.com')
session.driver.render('/tmp/disqus.png')
`open /tmp/disqus.png`
@Fluxx
Fluxx / poc.rb
Created February 14, 2012 00:24
require "capybara"
require 'capybara/poltergeist'
session = Capybara::Session.new(:poltergeist)
session.visit('http://www.disqus.com')
session.driver.render('/tmp/disqus.png')
`open /tmp/disqus.png`
conditional_skip_selenium = conditional_skip(lambda: ping_selenium(settings.SELENIUM_HOST,
settings.SELENIUM_PORT),
reason='Selenium is not responding')
# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)