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
#! -*- 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 |
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
# 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 |
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
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) { |