Skip to content

Instantly share code, notes, and snippets.

@chenbo515
chenbo515 / SimpleHTTPServerWithUpload.py
Created November 29, 2017 14:24 — forked from UniIsland/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
@chenbo515
chenbo515 / fncache.py
Created March 20, 2016 10:21 — forked from kwarrick/fncache.py
Redis-backed LRU cache decorator in Python.
#!/usr/bin/env python
__author__ = 'Kevin Warrick'
__email__ = 'kwarrick@uga.edu'
import cPickle
from functools import wraps
def redis_lru(capacity=5000, slice=slice(None)):
"""
Simple Redis-based LRU cache decorator *.
@chenbo515
chenbo515 / pass_socket.py
Created December 3, 2015 13:39 — forked from josiahcarlson/pass_socket.py
An example of passing a socket between processes using Python's multiprocessing library
'''pass_socket.py
Written September 14, 2012
Released into the public domain.
Works on Python 2.6, 2.7, and may need minor changes for 3+.
'''
import multiprocessing