Skip to content

Instantly share code, notes, and snippets.

View catwhocode's full-sized avatar

Cat who code catwhocode

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@catwhocode
catwhocode / cherryd.py
Created October 1, 2015 04:51 — forked from dbinit/cherryd.py
CherryPy Django server
import os
import socket
import urllib
import urlparse
import cherrypy
# Django settings
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings')
# Celery loader
@catwhocode
catwhocode / unserialize-php-session.py
Last active August 7, 2016 12:14 — forked from scragg0x/gist:3894835
Unserialize PHP Session in Python
def unserialize_session(val):
if not val:
return
session = {}
groups = re.split("([a-zA-Z0-9_]+)\|", val)
if len(groups) > 2:
groups = groups[1:]
groups = map(None, *([iter(groups)] * 2))
for i in range(len(groups)):