Skip to content

Instantly share code, notes, and snippets.

View kwlzn's full-sized avatar

Kris Wilson kwlzn

View GitHub Profile
@kwlzn
kwlzn / Makefile
Created May 6, 2014 00:37
uWSGI + pex Makefile
PYTHON := python2.6
BUILD_DIR := buildtmp
AURORA_CLUSTER := test
AURORA_ROLE := $(shell whoami)
UWSGI_VER = 2.0.4
UWSGI_DIR = uwsgi-$(UWSGI_VER)
UWSGI_FILE = $(UWSGI_DIR).tar.gz
UWSGI_URL = http://projects.unbit.it/downloads/$(UWSGI_FILE)
@kwlzn
kwlzn / uwsgi-pex.md
Last active June 13, 2018 15:55
uWSGI + pex

Building a test pex

setup.py

yakuza:src kw$ cat testapp/setup.py
#!/usr/bin/env python

from distutils.core import setup
@kwlzn
kwlzn / taskgraph.py
Last active November 30, 2017 10:04
#!/usr/bin/env python
from collections import deque
class TaskGraph(object):
''' simple acyclic, directed property graph with iteration
use case:
1) model nodes as dicts and dependencies as directed edges (name=occ -> name=twist)
2) start with all nodes colored down (_st=0)
@kwlzn
kwlzn / per.py
Created January 3, 2013 21:10
quick/dirty stdin line counter in python
#!/usr/bin/env python
import sys, time, select, signal
try: window = int(sys.argv[1])
except: print 'usage: %s <window>' % sys.argv[0]; sys.exit(1)
a_time, b_time = long( time.time() ), 0
count = 0
def ctrlc(signum, frame): sys.exit(0)