Skip to content

Instantly share code, notes, and snippets.

View will's full-sized avatar
🆒
ه҈ͣفͤ҈ͥ҉ͦ҈ͧ҉ͨ҈ͩ҉ͪ҈ͫ҉ͬ҈ͭ҉ͮ҈ͯ҉ͨ҈ͬ҉ͧ҈ͣ҉ͨ҈ͧ҉ͯ҈ͮ҉ͭ҈ͤ҉ͦ҈ͥ҉ͧ҈ͩ҉ͭ҈ͨ҉ͣ҈ͪ҉ͧ҈ͭ҉ͩ҈ͤ҉ͮ҈ͯ҉ͬ҈

Will Leinweber will

🆒
ه҈ͣفͤ҈ͥ҉ͦ҈ͧ҉ͨ҈ͩ҉ͪ҈ͫ҉ͬ҈ͭ҉ͮ҈ͯ҉ͨ҈ͬ҉ͧ҈ͣ҉ͨ҈ͧ҉ͯ҈ͮ҉ͭ҈ͤ҉ͦ҈ͥ҉ͧ҈ͩ҉ͭ҈ͨ҉ͣ҈ͪ҉ͧ҈ͭ҉ͩ҈ͤ҉ͮ҈ͯ҉ͬ҈
View GitHub Profile
@will
will / gist:217655
Created October 24, 2009 18:19 — forked from jseifer/gist:217637
#! /usr/bin/env ruby
#
# Save in your path as "isreg" and chmod +x. Then: isreg domain.com
#
puts `whois #{ARGV[0]}` =~ /No match for \"#{ARGV[0]}\"/mi ? "Hell No" : "Fuck Yes"
From 59c9acddfa87a5391f088153994f607208be57c1 Mon Sep 17 00:00:00 2001
From: Will Leinweber <will@bitfission.com>
Date: Mon, 16 Nov 2009 00:25:27 -0600
Subject: [PATCH] Documentation patch
* remove compiler from bootstrapping guide
* add more detailed information on some of the bootstrapping stages
* rename subtend to capi in most of the docs
** except the example in rubinius_spec.txt
---
@will
will / ~.rb
Created November 21, 2009 17:40
class String
def ~
self.reverse
end
end
~"hello" # => "olleh"
Results 46.85
System Info
Xbench Version 1.3
System Version 10.5.8 (9L31a)
Physical RAM 4096 MB
Model MacBook5,1
Drive Type FUJITSU MHZ2250BH FFS G1
Disk Test 46.85
Sequential 68.30
Uncached Write 88.60 54.40 MB/sec [4K blocks]
# randomly failing
# so this hack retries features
# i'm so, so sorry
class CucumberFeature
def initialize(path)
@path = path
@result = run
end
@will
will / evil.rb
Created January 19, 2010 04:19
# worst thing you can do to someone in ruby?
# fork this and add other evil
class Module
def method_added(method)
undef_method method if rand > 0.999999
end
end
<html>
<head>
<script language="javascript"
type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"
></script>
<style type="text/css" media="screen">
body {
font: 15em Helvetica, Arial, sans-serif;
text-align: center;
TypeError: can't convert nil into String
Backtrace:
/vendor/bundler_gems/ruby/1.8/gems/haml-2.2.17/lib/sass/files.rb:94:in `join'
/vendor/bundler_gems/ruby/1.8/gems/haml-2.2.17/lib/sass/files.rb:94:in `sassc_filename'
/vendor/bundler_gems/ruby/1.8/gems/haml-2.2.17/lib/sass/files.rb:23:in `tree_for'
/vendor/bundler_gems/ruby/1.8/gems/haml-2.2.17/lib/sass/plugin.rb:96:in `update_stylesheet'
/vendor/bundler_gems/ruby/1.8/gems/haml-2.2.17/lib/sass/plugin.rb:82:in `update_stylesheets'
/vendor/bundler_gems/ruby/1.8/gems/haml-2.2.17/lib/sass/plugin.rb:77:in `each'
/vendor/bundler_gems/ruby/1.8/gems/haml-2.2.17/lib/sass/plugin.rb:77:in `update_stylesheets'
class Array
def split_zip
partition = size/2.0
left = first( partition.ceil )
right = last( partition.floor )
left.zip(right).flatten.compact
end
end
[1].split_zip == [1] # => true
% rvm specs
jruby-1.4.0: jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2009-11-02 69fbfa3) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_17) [x86_64-java]
(in /Users/will/code/couchrest)
This spec requires 'active_support' to be loaded
........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Finished in 28.965 seconds