Skip to content

Instantly share code, notes, and snippets.

View voidspace's full-sized avatar

Michael Foord voidspace

View GitHub Profile
@voidspace
voidspace / mock-example-correction
Created March 5, 2011 17:07
Correct a mock example for the python mock comparison.
We couldn’t find that file to show.
@voidspace
voidspace / mailfix.py
Created May 20, 2018 16:15
Example of imaplib to batch delete and expunge emails by subject
from imaplib import IMAP4_SSL
HOST = 'mail.XXXX.com'
USERNAME = 'XXXX'
PASSWORD = 'XXXX'
SUBJECT_CHECK = b'[repository/thing]'
with IMAP4_SSL(HOST) as m:
m.login(USERNAME, PASSWORD)
m.select('INBOX')
@voidspace
voidspace / Dockerfile
Created January 8, 2020 11:41
Dockerfile template for Python 3.6 with conda
FROM ubuntu:18.04
RUN apt-get update --fix-missing
RUN apt-get upgrade -y
RUN apt-get -y install locales
RUN locale-gen en_US.UTF-8
ENV LC_CTYPE en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'