Skip to content

Instantly share code, notes, and snippets.

def what_is_gist
Sex::Pure
end
This is my gist.
There are many like it, but this one is mine.
It is my life.
I must master it as I must master my life.
Without me, gist is sad.
Without gist, I am sad.
It is more than a pastie clone - it's a versioned pastie! Through the eversexy git! <3
# Translation note:
# init() will not be needed. Our input is already ready to be read. (Alliteration :D)
# Translated from http://compilers.iecc.com/crenshaw/tutor1.txt
TAB = "\t"
class scanner:
def __init__(self):
self.input = list(raw_input())
find . -name ".git" -exec rm -rf {} \;
require 'benchmark'
TIMES = 10_000_000
:foo # Anal-retentivity
def thrice_yield
3.times { yield }
end
def thrice_block &block
3.times &block
"1.8.6"
"2008-03-03"
user system total real
block 35.650000 0.050000 35.700000 ( 35.717756)
symbol106.290000 3.940000 110.230000 (111.735975)
"1.8.6"
"2008-03-03"
user system total real
block 35.230000 0.020000 35.250000 ( 35.282963)
# ---- -- ---- stringray.rb ---- -- ----
module StringRay
VERSION = 2
# Splits a string into words. Not using the obvious names (+#split+, +#words+)
# because I want compatibility for inclusion into +String+.
def enumerate
ray = []
self.each_byte do |byte|
#!/bin/env ruby
############################################################################
# textilewc: Count words in a Textile file, if somewhat crudely.
# By Tammy Cravit, tammy@tammycravit.us
#
# $Revision$ $Date$
#
# If a single file is provided on the command line, it displays the number
# of words in the file. If multiple files are given on the command line, it
# generates a listing similar to the output of wc(1), except that directories
class Foo
def initialize &block
p instance_eval &block if block_given? # !> `&' interpreted as argument prefix
end
def const_missing const
"foobar"
end
end
Foo.new {self} # => #<Foo:0x27204>