This file contains 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
var monkeypatch = function(io) { | |
io.configure(function(){ | |
io.set("transports", ["xhr-polling"]); | |
io.set("polling duration", 10); | |
}); | |
io.handleRequest = _.wrap(io.handleRequest, function(next, req, res) { | |
res.writeHead = _.wrap(res.writeHead, function(next, status, headers) { | |
if (headers) { delete headers.Connection; } | |
return next.call(this, status, headers); | |
}); |
This file contains 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
var EBNF = (function(){ | |
var grammar = { | |
"lex": { | |
"rules": [ | |
["\\s+", "/* skip whitespace */"], | |
["[A-Za-z_]+", "return 'symbol';"], | |
["'[^']*'", "return 'symbol';"], | |
["\\\\.", "return 'symbol';"], | |
["bar", "return 'bar';"], | |
["\\(", "return '(';"], |
This file contains 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
{ | |
"data": { | |
"filename" : filename, // String. File name to upload | |
"md5" : md5, // String. MD5 hash of the file | |
"size" : size, // Integer. File size in KB | |
"path" : identifier // String. Custom identifier (if needed) | |
} | |
} |
This file contains 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
{ | |
"meta": { | |
"version": 2, | |
"code": 200 | |
}, | |
"data": { | |
"id": "4fbaf4a21f92e4448c000003", | |
"source_url": "http://chute.com:8000/media/6onqswj", | |
"upload_info": { | |
"signature" : "AWS AKIAJHAREFXBAH6SBLPA:LC7MOI4gIdTs7uH2o0alJRiYdvg=", |
This file contains 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
{ | |
"data": "http://avatars.io/4fb6de143d242d44da000001/haha" | |
} |
This file contains 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
Vagrant::Config.run do |config| | |
config.vm.box = "precise64" | |
end |
This file contains 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
>>> time ( up vm1; up vm2; ) | |
Virtual machine 'vm1' is created and registered. | |
UUID: 66e775d6-8c91-4cf1-8c20-742687f22399 | |
Settings file: '/Users/michaelmaltese/VirtualBox VMs/vm1/vm1.vbox' | |
Waiting for VM "vm1" to power on... | |
VM "vm1" has been successfully started. | |
Virtual machine 'vm2' is created and registered. | |
UUID: 8e073076-94ef-42b4-b64f-56f1ac836d6c | |
Settings file: '/Users/michaelmaltese/VirtualBox VMs/vm2/vm2.vbox' | |
Waiting for VM "vm2" to power on... |
This file contains 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
import multiprocessing as mp | |
import numpy as np | |
import Queue as queue | |
class NullQueue: | |
def put(self, *args): pass | |
def get(self, *args): raise queue.Empty | |
def empty(self): return True | |
def mapper_factory(Func): |
This file contains 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
# LDAP Auth | |
# coding=utf-8 | |
# pip install python-ldap | |
import ldap | |
from sys import stdin, stdout | |
stdout.write("Username: ") | |
USERNAME = stdin.readline().strip() |
OlderNewer