Skip to content

Instantly share code, notes, and snippets.

View EightAndAHalfTails's full-sized avatar

Jake Humphrey EightAndAHalfTails

  • Alcatel IP Networks
  • Harefield, London, UK
View GitHub Profile
size = 9
top = "63742AKRT"
bot = "3547RAQKT"
def score(t, b):
#print t
#print b
# No remaining cards to match
if len(t) == 0 or len(b) == 0:
#print "End"
autoload -U compinit promptinit
compinit
promptinit
## Include my private settings ##
if [[ -f $HOME/.zshrc.private ]]; then
. $HOME/.zshrc.private
fi
## Aliases ##
#! /usr/bin/env python3
# Warning: Hackish maths
# I sure wish I knew Haskell
# Grass always greener?
tx = 100e-6
tc = 2e-6
tu = 5e-6
ideal = False
@EightAndAHalfTails
EightAndAHalfTails / mkv2gif.py
Last active December 16, 2015 14:39
Python script to extract arbitrary gifs from mkv files. Subtitle support through a horribly convoluted method. Dependencies: ffmpeg, mkvextract, imagemagick, and the python module docopt
#!/usr/bin/env python
"""Extract animated gifs from mkv files
Usage:
mkv2gif.py [options] <input> <output>
mkv2gif.py (-h | --help)
mkv2gif.py --version
Options:
@EightAndAHalfTails
EightAndAHalfTails / animetitles.grm
Last active December 11, 2015 11:09
Grammar description for generating plausible-sounding anime titles. for use with polygen.
I ::= "title: Anime Titles\n"
^ "author: Jake Humphrey\n"
^ "language: english\n"
^ "status: Basic\n"
^ "topic: Anime\n"
^ "created: 22/01/2013\n";
S ::= +++++++++++++(\Object [and Object][^"!"])
| \Exclamation ^ "!"[^"!"[^"!"]] \Name
| '^\Object "Can't Possibly be this" \Adjective ^'
@EightAndAHalfTails
EightAndAHalfTails / coursename.grm
Last active December 11, 2015 10:19
Grammar description for generating plausible-sounding EEE course names. for use with polygen. >tfw I do Introduction to Electronics-Oriented Programming Development as pertaining to Nano-Scale Object-Oriented Systems Analysis
I ::= "title: Course Names\n"
^ "author: Jake Humphrey\n"
^ "language: english\n"
^ "status: Basic\n"
^ "topic: EIE\n"
^ "created: 21/01/2013\n";
S ::= ["Introduction to"] ComboModule;
ComboModule ::= Module [Conjunction Module];
@EightAndAHalfTails
EightAndAHalfTails / 15.cc
Created January 17, 2013 14:58
Project Euler 15
#include <iostream>
#define HEIGHT 16
#define WIDTH 16
using namespace std;
int main(void)
{
bool done = false;
@EightAndAHalfTails
EightAndAHalfTails / fizzbuzz.spl
Created December 1, 2012 20:21
Fizzbuzz in SPL
use Lingua::Shakespeare;
On a popular drinking game.
Tybalt, the player of today's game.
Romeo, who keeps butting in.
Balthazar, a limiting factor.
Act I: Before the game.
@EightAndAHalfTails
EightAndAHalfTails / mpd-before-pulse
Created May 3, 2012 17:17
a script that starts mpd during the Gnome3 login screen
#!/bin/bash
case "$1" in
start)
until pgrep pulseaudio &>/dev/null; do
sleep 0.5
done
sleep 1
rc.d start mpd >>/home/jake/log.txt
mpc pause >>/home/jake/log.txt
#include<stdio.h>
typedef enum bool {false, true} boolean ;
/* Input: an integer n > 1
*
* Let A be an array of Boolean values, indexed by integers 2 to n,
* initially all set to true.
*
* for i = 2, 3, 4, ..., while i ≤ n/2: