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
#!/usr/bin/env python | |
# import csv | |
# reader = csv.reader(open('4956984.csv', 'rb')) | |
def gen_chunks(reader, chunksize=100): | |
""" | |
Chunk generator. Take a CSV `reader` and yield | |
`chunksize` sized slices. | |
""" |
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
from flask import Flask, request | |
from gevent.event import AsyncResult | |
from gevent.wsgi import WSGIServer | |
app = Flask(__name__) | |
waiters = [] | |
@app.route("/") | |
def main(): |
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
#!/bin/sh | |
# Start/stop the named twistd application | |
# | |
APP=/opt/myapp/myapp.py | |
TWISTD=/usr/bin/twistd | |
PID=/var/run/myapp.pid | |
LOGFILE=/var/log/myapp/myapp.log | |
DESCRIPTION="Super duper Twisted apptacularness!" | |
NAME=myapp |
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
#!/bin/sh | |
set -e | |
# Ping FCGI server. Uses cgi-fcgi program from libfcgi library. | |
# Retrieves the root path (/) from host:port specified on command line. | |
if [ -z "$1" ] ; then | |
echo "Usage: $0 host:port|path/to/socket" >&2 | |
exit 1 | |
fi |
NewerOlder