Skip to content

Instantly share code, notes, and snippets.


Matthew Darby mjdarby

View GitHub Profile
mjdarby /
Last active Feb 1, 2020
Mario Maker Level Code Twitch Bot
#!/usr/bin/env python
import signal
import sys
import ssl
import argparse
import re
import threading
import irc.client
import jaraco.logging
import pytesseract
mjdarby /
Created Mar 23, 2015 - A script for generating vaguely-readable anagrams ... as long as you don't use punctuation.
# What's that? You like to use punctuation? Forget about it.
import sys
import random
if __name__ == "__main__":
string = sys.argv[1:]
anagrammed = []
for element in string:
mjdarby /
Created Mar 9, 2015 Quickly generate a CSV file for use in Anki from the tables on
# Just copy paste the tables from into
# the hard, soft, and split variables. Very quick, and VERY dirty.
hard = """Hard 2 3 4 5 6 7 8 9 10 A
5 H H H H H H H H H H
6 H H H H H H H H H H
7 H H H H H H H H H H
8 H H H H H H H H H H
9 H Dh Dh Dh Dh H H H H H
10 Dh Dh Dh Dh Dh Dh Dh Dh H H
mjdarby /
Created Sep 17, 2014
A dodgy edit of ansi2html to support reverse colours
# Convert ANSI (terminal) colours and attributes to HTML
# Licence: LGPLv2
# Author:
# Examples:
# ls -l --color=always | > ls.html
# git show --color | > last_change.html
mjdarby / gist:10596296
Last active Aug 29, 2015
Jedi.el setup
View gist:10596296
(add-hook ‘python-mode-hook ‘jedi:setup)
(setq jedi:setup-keys t)
(setq jedi:complete-on-dot t)
mjdarby /
Created Jan 5, 2014
Measuring the length of time taken to get through N key state tests in the Hullet Bells input handler
import pygame, time
from pygame.locals import *
class InputCallback:
def __init__(self, key, callback):
self.key = key
self.callback = callback
class InputHandler:
View example.css
html,body,#wrapper {
width: 100%;
height: 100%;
margin: 0px;
.chart {
font-family: Arial, sans-serif;
font-size: 12px;