Skip to content

Instantly share code, notes, and snippets.

Avatar

Matthew Darby mjdarby

View GitHub Profile
@mjdarby
mjdarby / mariobot.py
Last active Feb 1, 2020
Mario Maker Level Code Twitch Bot
View mariobot.py
#!/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
mjdarby / dumb.py
Created Mar 23, 2015
dumb.py - A script for generating vaguely-readable anagrams ... as long as you don't use punctuation.
View dumb.py
#!/usr/bin/python
# 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
mjdarby / blackjack.py
Created Mar 9, 2015
Blackjack.py: Quickly generate a CSV file for use in Anki from the tables on http://wizardofodds.com/games/blackjack/strategy/calculator/
View blackjack.py
# Just copy paste the tables from http://wizardofodds.com/games/blackjack/strategy/calculator/ 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
mjdarby / ansi2html-withreverse.sh
Created Sep 17, 2014
A dodgy edit of ansi2html to support reverse colours
View ansi2html-withreverse.sh
#!/bin/sh
# Convert ANSI (terminal) colours and attributes to HTML
# Licence: LGPLv2
# Author:
# http://www.pixelbeat.org/docs/terminal_colours/
# Examples:
# ls -l --color=always | ansi2html.sh > ls.html
# git show --color | ansi2html.sh > last_change.html
@mjdarby
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
mjdarby / main.py
Created Jan 5, 2014
Measuring the length of time taken to get through N key state tests in the Hullet Bells input handler
View main.py
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;
}