This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'csv' | |
require 'pp' | |
require 'time' | |
require 'readline' | |
require 'nokogiri' | |
lines = ARGF.read | |
time = Time.now.iso8601 | |
builder = Nokogiri::XML::Builder.new{|xml| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p: (obj) -> | |
if console and console.debug | |
console.debug obj | |
Array::index: (member) -> | |
for element, index in this | |
if element is member | |
return index | |
null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Router: require 'biggie-router' | |
router: new Router() | |
router.module('static', './public') | |
router.bind (req, res, next) -> | |
res.sendBody 404, "File not found" | |
router.listen 8080 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mime: { | |
".3gp" : "video/3gpp", | |
".a" : "application/octet-stream", | |
".ai" : "application/postscript", | |
".aif" : "audio/x-aiff", | |
".aiff" : "audio/x-aiff", | |
".asc" : "application/pgp-signature", | |
".asf" : "video/x-ms-asf", | |
".asm" : "text/x-asm", | |
".asx" : "video/x-ms-asf", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Router: require 'biggie-router' | |
router: new Router() | |
router.get(/\.(css|js|svg)$/).module 'gzip' | |
router.module 'static', './public' | |
router.bind (req, res, next) -> | |
res.sendBody 404, "File not found" | |
router.listen 8080 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var Router, router; | |
Router = require('biggie-router'); | |
router = new Router(); | |
router.get(/\.(css|js|svg)$/).module('gzip'); | |
router.module('static', './public'); | |
router.bind(function(req, res, next) { | |
return res.sendBody(404, "File not found"); | |
}); | |
router.listen(8080); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iota % rvm ruby sc.rb | |
info: jruby-1.5.1: jruby 1.5.1 (ruby 1.9.2dev trunk 24787) (2010-06-06 f3a3480) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_20) [amd64-java] | |
Rehearsal ---------------------------------------------- | |
scan 5.973000 0.000000 5.973000 ( 5.928000) | |
scan ++ 10.103000 0.000000 10.103000 ( 10.104000) | |
scan re 5.443000 0.000000 5.443000 ( 5.443000) | |
scan re ++ 10.329000 0.000000 10.329000 ( 10.329000) | |
while 8.482000 0.000000 8.482000 ( 8.482000) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
router.post('/save'). | |
bind (req, res, next) -> | |
chunks: [] | |
req.addListener 'data', (chunk) -> | |
chunks.push chunk | |
req.addListener 'end', -> | |
totalLength: chunks.reduce (sum, chunk) -> | |
sum + chunk.length |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env coffee | |
# Ext JS Connect | |
# Copyright(c) 2010 Ext JS, Inc. | |
# MIT Licensed | |
# Module dependencies. | |
child_process: require 'child_process' | |
netBinding: process.binding 'net' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
url: require 'url' | |
querystring: require 'querystring' | |
request: require 'request' | |
class Rpx | |
constructor: (apiKey) -> | |
@apiKey: apiKey | |
authInfo: (token, callback) -> | |
@apiCall 'auth_info', {token: token}, (data) -> |