I hereby claim:
- I am exbinary on github.
- I am exbinary (https://keybase.io/exbinary) on keybase.
- I have a public key ASBPAzoGUMfqjKund4SDNG57Qx-NiuW80viKbMd33DB_qAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
--- tmp/one 2015-06-19 17:29:38.000000000 -0400 | |
+++ tmp/two 2015-06-19 17:29:50.000000000 -0400 | |
@@ -984,11 +984,11 @@ | |
"size": 181796, | |
"digest": "49a82524d458cdf875e54fdb41333625" | |
}, | |
- "application2\/application-b7902869433757fd8fdd9424c55b2898.js": { | |
+ "application2\/application-00d3c79b5dd733de23c89a12745cf577.js": { | |
"logical_path": "application2\/application.js", | |
require 'forwardable' | |
module Delegate | |
def self.to_class(klass, *methods) | |
klass.extend(Forwardable) | |
klass.instance_eval do | |
def_delegators 'self.class', *methods | |
end | |
end | |
end |
require 'singleton' | |
class Loner | |
include Singleton | |
def foo bar | |
bar | |
end | |
def self.method_missing name, *args |
# for ruby-talk PM with El_Matador. | |
require 'nokogiri' | |
doc = Nokogiri::HTML.parse(<<-HTML_END) | |
"<html> | |
<body> | |
<p id='para-1'>A</p> | |
<div class='block' id='X1'> | |
<h1>Foo</h1> |
class One | |
def create_proc | |
Proc.new { puts self.class } | |
end | |
end | |
p = One.new.create_proc | |
p.call # => One | |
class Two |
# Benchmarking ways to insert a separator at every 80 characters of a string | |
# | |
# Original question asked here: | |
# http://www.nabble.com/Cut-a-string-each-80-character-td22343923.html | |
# | |
# This version based on improvements suggested by Robert Klemme | |
require 'benchmark' | |
S = ('0123456789' * (80 * 100)).freeze |
# Note: this script has to be sourced, just running it won't help | |
if [ '1.8' == $(ruby -e 'puts RUBY_VERSION[0,3]') ]; then | |
export PATH=/usr/local/ruby1.9/bin:$PATH | |
else | |
export PATH=$(echo $PATH | sed -e 's@/usr/local/ruby1.9/bin:@@') | |
fi | |
echo $(ruby -v) |