Skip to content

Instantly share code, notes, and snippets.

@mjdarby
mjdarby / example.css
Last active December 18, 2015 13:48 — forked from dk8996/example.css
html,body,#wrapper {
width: 100%;
height: 100%;
margin: 0px;
}
.chart {
font-family: Arial, sans-serif;
font-size: 12px;
}
@mjdarby
mjdarby / main.py
Created January 5, 2014 19:43
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:
@mjdarby
mjdarby / gist:10596296
Last active August 29, 2015 13:59
Jedi.el setup
(add-hook ‘python-mode-hook ‘jedi:setup)
(setq jedi:setup-keys t)
(setq jedi:complete-on-dot t)
@mjdarby
mjdarby / ansi2html-withreverse.sh
Created September 17, 2014 22:19
A dodgy edit of ansi2html to support reverse colours
#!/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 / blackjack.py
Created March 9, 2015 23:32
Blackjack.py: Quickly generate a CSV file for use in Anki from the tables on http://wizardofodds.com/games/blackjack/strategy/calculator/
# 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 / dumb.py
Created March 23, 2015 22:12
dumb.py - A script for generating vaguely-readable anagrams ... as long as you don't use punctuation.
#!/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 / mariobot.py
Last active February 1, 2020 23:37
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