Skip to content

Instantly share code, notes, and snippets.

View theacodes's full-sized avatar
🎛️
Bleep bloop

Stargirl Flowers theacodes

🎛️
Bleep bloop
View GitHub Profile
@theacodes
theacodes / appengine_config.py
Created September 2, 2014 22:28
appengine_config.py demonstrating how to properly add vendor packages to sys.path
"""
`appengine_config.py` gets loaded every time a new instance is started.
Use this file to configure app engine modules as defined here:
https://developers.google.com/appengine/docs/python/tools/appengineconfig
"""
def add_vendor_packages(vendor_folder):
"""
@theacodes
theacodes / gist:6753923
Created September 29, 2013 16:17
Memory profiling WSGI middleware
from collections import defaultdict
import gc
class MemoryProfilingMiddleware(object):
def __init__(self, app):
self.app = app
#gc.set_debug(gc.DEBUG_LEAK)
self.last_count = 0