- http://flickr.com
- http://cnn.com
- http://letsfreckle.com # You need to log in
class Stache18n | |
@@tags = { | |
'comment-and-close' => 'Comment and close', | |
'github' => 'GitHub', | |
'social-coding' => 'Social Coding' | |
} | |
def self.t | |
@@tags | |
end |
class Highlighter | |
def ruby(text) | |
"<pre class='ruby'>#{text}</pre>" | |
end | |
def python(text) | |
"<pre class='python'>#{text}</pre>" | |
end | |
end |
class HighlighterHelper | |
def respond_to?(language) | |
Highlighter.highlight?(language) | |
end | |
def method_missing(language) | |
lambda { |text| | |
Highlighter.send(language, text) | |
} | |
end |
#!/bin/sh -e | |
# | |
# Usage: jsize file.js | |
# Print the size of a minified & gzip'd js file. | |
# e.g. | |
# $ jsize src/facebox.js | |
# 1.4K | |
# | |
# Requires uglify-js |
# $ gh-get https://github.com/defunkt/facebox/blob/master/src/facebox.js | |
function gh-get () { | |
curl -#O $(echo $1 | sed 's|blob|raw|') | |
} |
2217 Time Zone V (EST) 7 Nov. 1970--NTC-- "Pop's Place": I was polishing a brandy snifter when the Unmarried Mother came in. I noted the time---10:17 P. M. zone five, or eastern time, November 7th, 1970. Temporal agents always notice time and date; we must.
The Unmarried Mother was a man twenty--five years old, no taller than I am, childish features and a touchy temper. I didn't like his looks---I never had---but he was a lad I was here to recruit, he was my boy. I gave him my best barkeep's smile.
Maybe I'm too critical. He wasn't swish; his nickname came from what he always said when some nosy type asked him his line: "I'm an unmarried mother." If he felt less than murderous he would add: "at four cents a word. I write confession stories."
If he felt nasty, he would wait for somebody to make something of it. He had a lethal style of infighting, like a female cop---reason I wanted him. Not the only one.
$ CACHED=1 ruby -rubygems -I lib benchmarks/speed.rb | |
Rehearsal --------------------------------------------------- | |
ERB w/ caching 0.190000 0.000000 0.190000 ( 0.200326) | |
HAML w/ caching 0.810000 0.010000 0.820000 ( 0.846492) | |
{{ w/ caching 0.840000 0.000000 0.840000 ( 0.842275) | |
------------------------------------------ total: 1.850000sec | |
user system total real | |
ERB w/ caching 0.190000 0.010000 0.200000 ( 0.194241) | |
HAML w/ caching 0.810000 0.010000 0.820000 ( 0.823237) |
# sh function to murder all running processes matching a pattern | |
# thanks 3n: http://twitter.com/3n/status/19113206105 | |
murder () { | |
ps | grep $1 | grep -v grep | awk '{print $1}' | xargs kill -9 | |
} |
;; Automatically add, commit, and push when files change. | |
(defvar autocommit-dir-set '() | |
"Set of directories for which there is a pending timer job") | |
(defun autocommit-schedule-commit (dn) | |
"Schedule an autocommit (and push) if one is not already scheduled for the given dir." | |
(if (null (member dn autocommit-dir-set)) | |
(progn | |
(run-with-idle-timer |