Skip to content

Instantly share code, notes, and snippets.

View chadoh's full-sized avatar
🌲

Chad Ostrowski chadoh

🌲
View GitHub Profile
@chadoh
chadoh / Img blur 1
Last active November 13, 2015 02:30 — forked from umasenthil/Img blur 1
class Image
def initialize(arr)
@arr = arr
end
def print
@arr.each do |sub_array|
puts sub_array.join('')
end
end
Nokogiri was built against LibXML version 2.7.8, but has dynamically loaded 2.8.0
gem uninstall nokogiri -xI;
brew update;
brew uninstall libxml2;
brew install libxml2 --with-xml2-config;
brew link libxml2;
brew install libxslt;
@chadoh
chadoh / Error.txt
Created May 15, 2012 19:50 — forked from tatey/benchmark.rb
Mocha VS MiniTest::Mock and SimpleDelegate VS SimpleMock
⮁ ruby benchmark.rb > benchmark.txt
benchmark.rb:33:in `block (3 levels) in <main>': undefined method `push' for #<RR::DoubleDefinitions::DoubleDefinition:0x007fe9aa28e240> (NoMethodError)
from benchmark.rb:31:in `times'
from benchmark.rb:31:in `block (2 levels) in <main>'
from /Users/costro0001/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/benchmark.rb:280:in `measure'
from /Users/costro0001/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/benchmark.rb:362:in `item'
from benchmark.rb:30:in `block in <main>'
from /Users/costro0001/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/benchmark.rb:174:in `benchmark'
from /Users/costro0001/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/benchmark.rb:205:in `bm'
from benchmark.rb:11:in `<main>'
@chadoh
chadoh / partials.rb
Created May 6, 2010 03:29 — forked from lenary/partials.rb
An implementation of partials for Sinatra, with support for a :spacer_string parameter (like rail's :spacer_template, but less robust and more tailored to my needs). See how it's used here: http://github.com/chadoh/lisli/blob/master/views/_post.haml
# stolen from http://gist.github.com/119874 and made a tiny bit more robust by me
# this implementation uses haml by default. if you want to use any other template mechanism
# then replace `erb` on line 23 and line 31 with `erb` or whatever
#This implementation varies from lenary's because it allows a :spacer_string to be specified
# a spacer_string works the same way as a :spacer_template in rails,
# except instead of rendering a page it plops in a string,
# but only in between elements of the collection, not at the end.
# This is useful if you have, say, a collection of blog tags,
# rendered as a collection of links with commas between them.