Skip to content

Instantly share code, notes, and snippets.

View sferik's full-sized avatar

Erik Berlin sferik

View GitHub Profile
ruby-1.9.2-head :001 > a = {}
=> {}
ruby-1.9.2-head :002 > a["☃"] = 1
=> 1
ruby-1.9.2-head :003 > a
=> {"☃"=>1}
iterations = 100
test_file = "#{File.dirname(__FILE__)}/benchmark.md"
implementations = [
{class_name: 'BlueCloth', gem_name: 'bluecloth', require_name: 'bluecloth'},
{class_name: 'RDiscount', gem_name: 'rdiscount', require_name: 'rdiscount'},
{class_name: 'Maruku', gem_name: 'maruku', require_name: 'maruku'},
{class_name: 'PEGMarkdown', gem_name: 'rpeg-markdown', require_name: 'peg_markdown'},
]
# Attempt to require each implementation and remove any that are not
require "rubygems"
require "rbench"
class A
def initialize(hash={})
hash.each do |key, value|
instance_variable_set(:"@#{key}", value)
end
end
end
# Helper function that returns a number with its correct indefinite article
# e.g. number_with_indefinite_article(10) #=> "a 10"
# e.g. number_with_indefinite_article(80, "$") #=> "an $80"
def number_with_indefinite_article(number, prefix=nil)
[indefinite_article_for_number(number), " ", prefix, number].compact.join
end
# Helper function that returns the correct indefinite article for a number
# e.g. indefinite_article_for_number(10) #=> "a"
# e.g. indefinite_article_for_number(80) #=> "an"
commit 719d2cddb8452d2252b221b0f82918113ddda6ff
Author: Erik Michaels-Ober <sferik@gmail.com>
Date: Sat Mar 17 09:17:20 2012 -0600
New Rails engine
diff --git a/.gitignore b/.gitignore
index eb3489a..1dfe31e 100644
--- a/.gitignore
+++ b/.gitignore
@sferik
sferik / gist:2422452
Created April 19, 2012 17:27
Twitter relationships
___________________________________________________
| | |
| YOU FOLLOW THEM | YOU DON'T FOLLOW THEM |
_________________________|_________________________|_________________________|
| | | |
| THEY FOLLOW YOU | FRIEND | FOLLOWER |
|_________________________|_________________________|_________________________|
| | | |
| THEY DON'T FOLLOW YOU | ??? | USER |
|_________________________|_________________________|_________________________|
ssh-dss AAAAB3NzaC1kc3MAAACBAJz7HanBa18ad1YsdFzHO5Wy1/WgXd4BV+czbKq7q23jungbfjN3eo2a0SVdxux8GG+RZ9ia90VD/X+PE4s3LV60oXZ7PDAuyPO1CTF0TaDoKf9mPaHcPa6agMJVocMsgBgwviWT1Q9VgN1SccDsYVDtxkIAwuw25YeHZlG6myx1AAAAFQCgW+OvXWUdUJPBGkRJ8ML7uf0VHQAAAIAlP5G96tTss0SKYVSCJCyocn9cyGQdNjxah4/aYuYFTbLI1rxk7sr/AkZfJNIoF2UFyO5STbbratykIQGUPdUBg1a2t72bu31x+4ZYJMngNsG/AkZ2oqLiH6dJKHD7PFx2oSPalogwsUV7iSMIZIYaPa03A9763iFsN0qJjaed+gAAAIBxz3Prxdzt/os4XGXSMNoWcS03AFC/05NOkoDMrXxQnTTpp1wrOgyRqEnKz15qC5dWk1ynzK+LJXHDZGA8lXPfCjHpJO3zrlZ/ivvLhgPdDpt13MAhIJFH06hTal0woxbk/fIdY71P3kbgXC0Ppx/0S7BC+VxqRCA4/wcM+BoDbA== host
From William Thurston: On proof and progress in mathematics
http://arxiv.org/pdf/math/9404236v1.pdf
When a significant theorem is proved, it often (but not always) happens that the solution can be communicated in a matter of minutes from one person to another within the subfield. The same proof would be communicated and generally understood in an hour talk to members of the subfield. It would be the subject of a 15- or 20-page paper, which could be read and understood in a few hours or perhaps days by members of the subfield.
Why is there such a big expansion from the informal discussion to the talk to the paper? One-on-one, people use wide channels of communication that go far beyond formal mathematical language. They use gestures, they draw pictures and diagrams, they make sound effects and use body language. Communication is more likely to be two-way, so that people can concentrate on what needs the most attention. With these channels of communication, they are in a much better position to convey what's
.highlight {
background: white;
}
/* Comment */
.highlight .c {
color: #988;
font-style: italic;
}
@sferik
sferik / emoji.txt
Created September 20, 2012 04:05 — forked from stephencelis/emoji.txt
Emoji not on the iOS Keyboard
2139 ℹ INFORMATION SOURCE
23EB ⏫ BLACK UP-POINTING DOUBLE TRIANGLE
23EC ⏬ BLACK DOWN-POINTING DOUBLE TRIANGLE
23F0 ⏰ ALARM CLOCK
23F3 ⏳ HOURGLASS WITH FLOWING SAND
26C5 ⛅ SUN BEHIND CLOUD
26D4 ⛔ NO ENTRY
2705 ✅ WHITE HEAVY CHECK MARK
2753 ❓ BLACK QUESTION MARK ORNAMENT
2757 ❗ HEAVY EXCLAMATION MARK SYMBOL