This file contains hidden or 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
module V1 | |
def self.doit(opts = {}) | |
opts.each_pair do |k,v| | |
define_method(k, &v) | |
end | |
end | |
doit a: -> { b } | |
doit b: -> { 'b' } |
This file contains hidden or 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
--- zeroclipboard-rails/app/assets/javascripts/zeroclipboard/ZeroClipboard.js 2013-11-10 10:04:08.968800717 +0000 | |
+++ zeroclipboard/ZeroClipboard.js 2013-11-10 10:04:20.840117981 +0000 | |
@@ -20,17 +20,6 @@ | |
} | |
return y; | |
}; | |
- var _getZoom = function(obj) { | |
- var zoom = 1; | |
- if(RegExp(' AppleWebKit/').test(navigator.userAgent)){ | |
- while(obj) |
This file contains hidden or 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
daemonize yes | |
pidfile /var/run/redis.pid | |
port 6379 | |
timeout 0 | |
bind 127.0.0.1 | |
tcp-keepalive 0 | |
loglevel notice | |
logfile stdout | |
databases 16 | |
save 900 1 |
This file contains hidden or 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
# Activate the gem you are reporting the issue against. | |
gem 'activerecord', '4.0.0' | |
require 'active_record' | |
require 'minitest/autorun' | |
require 'logger' | |
# This connection will do for database-independent bug reports. | |
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:') | |
ActiveRecord::Base.logger = Logger.new(STDOUT) |
This file contains hidden or 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 'nokogiri' | |
require 'open-uri' | |
doc = Nokogiri::HTML(open('http://a16z.com/portfolio/')) | |
def collect_up(string,lvals) | |
progress = [string] | |
# Result hash | |
result = {} |
This file contains hidden or 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
# Take a string that contains colon separated lval:rval pairs | |
# Produce a hash that collects the rvals for the lvals. E.g. | |
# | |
# "Fruit:orangeSize:largeQuantity:5Fruit:Apple" | |
# | |
# when considered with the lvals of: | |
# | |
# %w(Fruit: Size: Quantity: Fresh:) | |
# | |
# results in: |
NewerOlder