Skip to content

Instantly share code, notes, and snippets.

View christianp's full-sized avatar

Christian Lawson-Perfect christianp

View GitHub Profile
@christianp
christianp / happify.gv
Created February 29, 2012 08:48
Happification and melancoils
digraph{
overlap=false;
splines=true;
"d0" [label="0"];
"d1" [label="1"];
"d2" [label="2"];
"d4" [label="4"];
"d16" [label="16"];
"d37" [label="37"];
"d58" [label="58"];
@christianp
christianp / gist:2711746
Created May 16, 2012 16:13
BB Control DisplayError log
SCORM Engine Log
Version not.official.release.15337 keyboard shortcuts: refresh "r", close "esc"
Displaying: Control Runtime Sequencing Sequencing P-Code Look-ahead P-Code Refresh All
Refresh With Filter Expand All
Collapse All Send to Support
Save Debug Log
@christianp
christianp / gist:2891557
Created June 7, 2012 21:14
Using random walks on regular expressions to generate passwords
Regular expressions are equivalent to finite state automata. (well, lookahead needs a pushdown automaton, but that's OK)
Describe password constraints using regular expressions.
Randomly traverse the FSA corresponding to a password constraint. A path ending in an accepting state is a valid password.
@christianp
christianp / alphabat.py
Created June 10, 2012 21:35
Trying to find the reordering of the alphabet containing the most (contiguous) English words
import sys
import pickle
import operator
import itertools
alphabet = 'abcdefghijklmnopqrstuvwxyz'
#test if a word uses letters at most once
def monoglyphic(word):
word = sorted(word)
@christianp
christianp / README.md
Created June 11, 2012 19:00
convert a stream of uniform random binary digits into a stream of uniform random base-n digits
@christianp
christianp / gist:3098024
Created July 12, 2012 13:13
SCORM cloud PENS import
https://cloud.scorm.com/ScormEngineInterface/PENS.jsp?command=collect&pens-version=1.0.0&package-type=scorm-pif&package-type-version=1.3&package-format=zip&package-id=http%3A//tallaght.ncl.ac.uk/exam/1/mas1041_20122013_cba1/&package-url=http%3A//tallaght.ncl.ac.uk/exam/1/mas1041_20122013_cba1.zip%3Fscorm&package-url-expiry=2013-05-20T1T16%3A05%3A39Z&client=Christian%20Perfect&receipt=mailto%3Achristianperfect@gmail.com&alerts=mailto%3Achristianperfect@gmail.com&system-user-id=<<<app ID from SCORM Cloud>>>&system-password=<<<secret key from SCORM Cloud>>>
@echo off
IF %1==north cd ..
IF not %1==north cd %*
@christianp
christianp / arg.js
Created July 25, 2012 14:40
Relative module definitions with requireJS
define({a:1});
#!/bin/sh
EDITOR_PATH=/srv/www/numbas.mas.ncl.ac.uk80/numbas/
PYTHON=python2.6
echo "Updating Numbas"
cd /srv/numbas/dist
git pull
echo "Updating editor"
cd $EDITOR_PATH
git pull
$PYTHON manage.py syncdb
@christianp
christianp / README.md
Created July 30, 2012 13:43
de Bruijn sequence for a card trick