Skip to content

Instantly share code, notes, and snippets.

View mauritsvanrees's full-sized avatar

Maurits van Rees mauritsvanrees

View GitHub Profile
@mauritsvanrees
mauritsvanrees / keybase.md
Created January 13, 2015 21:39
Proof myself for keybase.io

Keybase proof

I hereby claim:

  • I am mauritsvanrees on github.
  • I am mauritsvanrees (https://keybase.io/mauritsvanrees) on keybase.
  • I have a public key whose fingerprint is 63C2 2569 E48E D8FB 0067 E5BB 7AE1 712D C8E7 0923

To claim this, I am signing this object:

@mauritsvanrees
mauritsvanrees / gist:3a4feaf60b26547bbb86
Created June 17, 2014 22:38
Open a Zope FileStorage at a specific date and time, and copy that state to a new file. May give POSKeyError though.
import ZODB.FileStorage
import logging
import sys
from ZODB.TimeStamp import TimeStamp
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger('truncate')
if len(sys.argv) != 4:
print("Usage: %s <source-filestorage> <target-filestorage> "
local_authors.txt
authors.cfg
@mauritsvanrees
mauritsvanrees / gist:5669913
Last active December 17, 2015 20:48
$ curl -i http://pypi.python.org/simple/pep8/ # This run gives back gzipped html
HTTP/1.1 200 OK
Server: nginx/1.1.19
Content-Type: text/html; charset=utf-8
Content-encoding: gzip
Strict-Transport-Security: max-age=31536000
Cache-Control: max-age=3600, public
Via: 1.1 varnish
Content-Length: 829
Accept-Ranges: bytes
Date: Wed, 29 May 2013 12:26:04 GMT
@mauritsvanrees
mauritsvanrees / nuke_trailing_white_space.sh
Created February 21, 2013 16:57
Nuke trailing white space in several types of file.
#! /bin/sh
echo "Nukes all trailing white space in *pt and *py and some other files."
FOR_REAL=0
if test $# -eq 1; then
if test $1 = "-y"; then
FOR_REAL=1
fi
fi
if test $FOR_REAL -eq 1; then
@mauritsvanrees
mauritsvanrees / setuptools_subversion.py
Created October 19, 2011 15:18
Setuptools revision control system plugin for Subversion; taken from Martijn Pieters: http://pypi.python.org/pypi/setuptools_subversion
#!/usr/bin/env python
try:
from subprocess import CalledProcessError
CalledProcessError # pyflakes
except ImportError:
CalledProcessError = SystemError
from subprocess import PIPE
from distutils.log import warn
@mauritsvanrees
mauritsvanrees / buildout_extends_grabber.py
Last active October 26, 2023 23:24
Parse buildout.cfg and recursively download all extends files that are online
"""
Parse buildout.cfg and recursively download all extends files that are online
Usage::
python buildout_extends_grabber.py [url or path to buildout file]
Needs Python 3.7 or higher.
Examples::