Skip to content

Instantly share code, notes, and snippets.

View kschiess's full-sized avatar
💭
see .plan

Kaspar Schiess kschiess

💭
see .plan
View GitHub Profile
@kschiess
kschiess / gist:772799
Created January 10, 2011 14:02
A minimal filtered rspec run (and a quine)
# 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
@kschiess
kschiess / gist:757123
Created December 28, 2010 10:31
a patch for the map gem
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(-)
@kschiess
kschiess / coldir.rb
Created December 10, 2010 15:24
Gathers key information about a directory.
#!/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|
@kschiess
kschiess / symbol_hash_to_a.rb
Created May 3, 2010 06:50 — forked from floere/symbol_hash_to_a.rb
Exploration on to_proc and each
# 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