Skip to content

Instantly share code, notes, and snippets.

View romanvm's full-sized avatar

Roman Miroshnychenko romanvm

View GitHub Profile
@romanvm
romanvm / gfm.py
Created November 10, 2015 16:52 — forked from christian-oudard/gfm.py
Github Flavored Markdown in Python
import re
from hashlib import md5
def gfm(text):
# Extract pre blocks.
extractions = {}
def pre_extraction_callback(matchobj):
digest = md5(matchobj.group(0)).hexdigest()
extractions[digest] = matchobj.group(0)
return "{gfm-extraction-%s}" % digest
@romanvm
romanvm / threadpoolss.py
Last active February 15, 2021 00:36 — forked from kgaughan/threadpoolss.py
All the thread pool mixins for SocketServer are, well, not that good, so I knocked together my own. This one can cleanly shut down the pool
"""
Thread pool extensions to SocketServer.
"""
import Queue
import SocketServer
import sys
import threading