View pytz_patch.py
""" | |
Import hook extending pytz package with usable, generic timezones: | |
GMT-14 up to GMT+12. | |
Note that pytz already has Etc/GMT+X timezones, but | |
(quoting Wikipedia): | |
"In order to conform with the POSIX style, those zones beginning with "Etc/GMT" | |
have their sign reversed from what most people expect. In this style, | |
zones west of GMT have a positive sign and those east have a negative sign." |
View minimal.tex
\def\reciperule{ | |
\vskip0.5em\hrule\vskip0.5em | |
} | |
\def\beginrecipe{ | |
\par | |
\begingroup | |
\leftskip=\baselineskip | |
\multiply\leftskip by 2 | |
\rightskip=\leftskip | |
\parindent=-\baselineskip |
View Push Me, Pull Me
title Push Me / Pull Me | |
author Ian Millington | |
homepage idm.me.uk | |
key_repeat_interval 0.25 | |
======== | |
OBJECTS | |
======== |
View pushme-pullme.puzzlescript
title Push Me / Pull Me | |
author Ian Millington | |
homepage agon.com | |
key_repeat_interval 0.25 | |
======== | |
OBJECTS | |
======== | |
Background1 |
View naivebayes.py
import collections | |
import re | |
import math | |
class NaiveBayesClassifier: | |
""" | |
A simple naive bayes classifier that can classify any items into | |
any number of categories based on training data. The core | |
algorithms in this class are generic, but `split_into_features` is | |
specific for analysing words in a message, and the data functions |
View separated-list.py
def sep(text_list, mid_sep=', ', last_sep=' and '): | |
""" | |
Separates a list of strings or unicode with the given separator, | |
adding a different separator at the end. | |
This allows the simple generation of strings such as: | |
"A, B, C and D" | |
>>> sep([]) |
View node-uuid.js
/** | |
* Generates a new UUID and passes it to the given callback function. | |
* | |
* Uses the a command-line uuid generator. Caches UUIDs to avoid | |
* unneccessary spawning of new processes. | |
* | |
* You can easily adjust the script used to create the UUID. By | |
* default I am using the OSSP uuid program, which is available in | |
* most linux distro's package managers (e.g. `sudo apt-get install | |
* uuid` on ubuntu). |