Skip to content

Instantly share code, notes, and snippets.

View j2labs's full-sized avatar

The Ghost Of J2 Labs j2labs

View GitHub Profile
@j2labs
j2labs / core.py
Created March 4, 2012 09:17 — forked from kracekumar/core.py
parallelpip demo
#! -*- Coding: utf-8 -*-
"""
Before running the create a virtualenv (I used version 1.7, so no-site-packages is default), activate virtualenv and install gevent, envoy and try running
"""
from gevent import monkey
monkey.patch_all()
import gevent
import time
# gevent
from gevent import monkey
monkey.patch_all()
from gevent.wsgi import WSGIServer
http_server = WSGIServer(('', port), app)
http_server.serve_forever()
# tornado
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
@j2labs
j2labs / gist:1247166
Created September 28, 2011 06:46 — forked from gtzilla/gist:1247115
arity binding decorator for javascript
function arity_decorator(fun) {
function wrapped() {
if(arguments.length != fun.length)
throw new Error("Y U NO USE RIGHT?!")
fun.apply(this, arguments);
}
return wrapped;
}
function foo(x, y) {