Skip to content

Instantly share code, notes, and snippets.

View callmewhy's full-sized avatar
🐒

Haiyang Wang callmewhy

🐒
  • Singapore
View GitHub Profile
@callmewhy
callmewhy / test_pep8.py
Last active September 22, 2016 15:27 — forked from swenson/test_pep8.py
Test for running PEP8 against all Python files. Useful to hook up to nose and as part of your CI.I modify PEP8 in two ways by default: don't enforce 4-spacing (I prefer 2-spacing), and use 100 for the default line length, because we don't use 80-column punch cards anymore.Licensed under CC0 (public domain): do what you want. http://creativecommo…
import os
import os.path
import unittest
import pep8
ignore_patterns = ('.git',)
def ignore(check_dir):
for pattern in ignore_patterns:
@callmewhy
callmewhy / defer.py
Last active May 27, 2016 06:50 — forked from cliffxuan/defer.py
wxPython non blocking gui with long running task and timeout
import threading
import Queue
import wx
def run(function,
args=None,
timeout=None,
finish_function=None,