Skip to content

Instantly share code, notes, and snippets.

View zdzolton's full-sized avatar

Zach Zolton zdzolton

View GitHub Profile
@zdzolton
zdzolton / map.coffee
Created January 6, 2012 03:43 — forked from plesiecki/map.js
Hadoop Streaming with Node.js (CoffeeScript edition)
#!/usr/bin/env coffee
stdin = process.openStdin()
stdout = process.stdout
input = ''
stdin.setEncoding 'utf8'
stdin.on 'data', (data) ->
return unless data?
@zdzolton
zdzolton / gist:3019289
Created June 29, 2012 17:08
Super useful Site Stream API error from Twitter
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Error 401 Unauthorized</title>
</head>
<body>
<h2>HTTP ERROR: 401</h2>
<p>Problem accessing '/2b/site.json'. Reason:
<pre> Unauthorized</pre>
@zdzolton
zdzolton / gist:6143926
Created August 2, 2013 22:17
Hacking Roman Numeral support onto Ruby numbers...
class Fixnum
NUMERALS = {
1000 => %w(M),
100 => %w(C D),
10 => %w(X L),
1 => %w(I V),
}
def to_roman
raise "Out of range" unless (1...3000).include?(self)