I hereby claim:
- I am kschiess on github.
- I am kschiess (https://keybase.io/kschiess) on keybase.
- I have a public key whose fingerprint is 410C D966 C2FE D140 1ADA 77E9 8C67 10A3 D7A0 791E
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
# Its easy really, you want the proc to 'plus' to arguments really, so | |
# just put a plus in there! | |
# (Or: Most flagrant abuse of unary plus) | |
class AsArgument < Struct.new(:symbol) | |
def to_proc | |
proc { |el| send(symbol, el) } | |
end | |
end | |
class Symbol |
#!/opt/csw/bin/ruby | |
directory = ARGV.join(' ') | |
count = ['?', '?'] | |
# get users, which have created files in dir | |
# | |
users = Hash.new(0) | |
`tree -u '#{directory}'`.split("\n").each do |line| |
From 76d3b0e6e95097915e210faccc226562fe2723de Mon Sep 17 00:00:00 2001 | |
From: Kaspar Schiess <kaspar.schiess@absurd.li> | |
Date: Tue, 28 Dec 2010 11:24:04 +0100 | |
Subject: [PATCH 1/2] . ignores argument and is thus a proc | |
--- | |
lib/map.rb | 2 +- | |
1 files changed, 1 insertions(+), 1 deletions(-) |
# puts (s="puts (s=%s)%%s.dump")%s.dump | |
require 'rspec' | |
RSpec::Core::Runner.disable_autorun! | |
describe "foo" do | |
it "bar" do | |
end | |
it "baz", :banane => true do | |
end |
require 'rubygems' | |
require 'parslet' | |
require 'pp' | |
class JSON < Parslet::Parser | |
rule(:space) { match('\s').repeat(1) } | |
rule(:space?) { space.maybe } | |
rule(:quote) { str('"') } | |
rule(:nonquote) { str('"').absnt? >> any } | |
rule(:comma) { str(',') >> space? } |
#!/usr/bin/env ruby | |
require 'ruby_parser' | |
class Graph | |
def initialize | |
@watch_lvars = [] | |
end | |
def visit(tree) |
class Matcher | |
def initialize(expr) | |
@expr = expr | |
end | |
def ===(value) | |
@bindings = {} | |
match(@expr, value, @bindings) | |
end |
require 'parslet' | |
require 'parslet/convenience' | |
require 'pp' | |
def parse(input) | |
parser = SongParser.new | |
begin | |
tree = parser.parse(input) | |
rescue Parslet::ParseFailed => error | |
puts error, parser.root.error_tree |
class Module | |
def with_rake_pollution_prevention_append_features(klass) | |
unless caller.first.match(/rake/) && self.name == "Rake::DeprecatedObjectDSL" | |
without_rake_pollution_prevention_append_features(klass) | |
end | |
end | |
alias without_rake_pollution_prevention_append_features append_features | |
alias append_features with_rake_pollution_prevention_append_features | |
end |