Skip to content

Instantly share code, notes, and snippets.

View slank's full-sized avatar
⁉️
wat

Matthew Wedgwood slank

⁉️
wat
View GitHub Profile
@slank
slank / logging.py
Created November 4, 2022 22:00
Python color multiline log formatter with example logger setup
import logging
import os
# DEFAULT_FMT = "(%(filename)s:%(lineno)d) %(message)s"
DEFAULT_FMT = "%(message)s"
class ColorMultilineLogFormatter(logging.Formatter):
grey = "\x1b[37m"
bold_grey = "\x1b[37;1m"
blue = "\x1b[34;1m"
@slank
slank / keybase.md
Created August 15, 2018 04:54
keybase.md

Keybase proof

I hereby claim:

  • I am slank on github.
  • I am wedgwood (https://keybase.io/wedgwood) on keybase.
  • I have a public key ASCs5dyYy2UpbM9_IS4r0fz95j6bJci_XexdTWMEmo3bTwo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am slank on github.
  • I am wedgwood (https://keybase.io/wedgwood) on keybase.
  • I have a public key whose fingerprint is B02A 291E 4811 5FEE FECF 2A67 DE8F 06EA 1781 176C

To claim this, I am signing this object:

@slank
slank / Notes
Created June 4, 2015 04:41
Bash Power Tips Walkthrough
# Variables
FOO=here
FOO="here" # equivalent, always use quotes
BAR=$FOO
BAR="$FOO"
BAR="${FOO}"
BAR='$FOO' # single quotes, does not evaluate the variable
@slank
slank / gist:df395a38ae26149f17c2
Last active June 23, 2016 10:00
Launchd Config for on-demand SSH tunnel
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.openssh.port-forwards</string>
<key>OnDemand</key>
<true/>
<key>ProgramArguments</key>
<array>
@slank
slank / gist:4752347
Last active December 12, 2015 09:29 — forked from xfenix/gist:3206768
"""sendmail email backend class for postfix."""
import threading
from django.conf import settings
from django.core.mail.backends.base import BaseEmailBackend
from subprocess import Popen,PIPE
class EmailBackend(BaseEmailBackend):
def __init__(self, fail_silently=False, **kwargs):