Skip to content

Instantly share code, notes, and snippets.

@jnhmcknight
jnhmcknight / mandrill-hook-utils.py
Last active April 27, 2020 15:02
Mandrill webhook decorator
"""
Utilities for use with Mandrill Webhooks
requirements:
- six
- email-reply-parser (git+https://github.com/atc0m/email-reply-parser.git#egg=email_reply_parser)
"""
import base64
@jnhmcknight
jnhmcknight / inject_ca.py
Created July 10, 2018 16:01
Inject an arbitrary certificate authority into a certifi bundle
#!/usr/bin/env python
"""
Usage: python ./inject_ca.py <path/to/new/ca.crt> [<path/to/other/new/ca.crt> [...]]
"""
import certifi
import os
import re
import sys
@jnhmcknight
jnhmcknight / colour-inverter.py
Created June 15, 2018 14:09
Invert all colours in a CSS file.
#!/usr/bin/env python
# Concept taken from http://code.activestate.com/recipes/527747-invert-css-hex-colors/
# Modified to take the css filename as an argument and also handle rgb() and rgba() values
#
# To run:
# python ./colour-inverter.py <path/to/file.css>
import os
import re
@jnhmcknight
jnhmcknight / headers.py
Created December 1, 2017 21:37
S3-website-cache-control-setter
# -*- coding: utf-8 -*-
from flask import Flask
import logging
import boto3
import os
from copy import deepcopy

Keybase proof

I hereby claim:

  • I am jnhmcknight on github.
  • I am jnhmcknight (https://keybase.io/jnhmcknight) on keybase.
  • I have a public key whose fingerprint is 6354 4B36 99BD 04CC 56B2 63F1 D2C8 64A5 BAC3 1834

To claim this, I am signing this object: