This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"encoding/binary" | |
"fmt" | |
"math" | |
"os" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
This is a quick hack for downloading albums from Bandcamp. | |
This functionality should really be added to youtube-dl, but I'm lazy and just | |
wanted to listen to an album on a computer without flash so I wrote this. Somone, | |
please add bandcamp support to youtube-dl! | |
Instructions: give this a bandcamp album's HTML on stdin, and it gives you a | |
bash script on stdout which will download it. There is no sanitization of the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
A very simple plotting tool. | |
""" | |
__license__ = """ | |
This software may be freely used, modified, and redistributed without any | |
restrictions except one: you agree to pay the author $1M if you ever tell him | |
there will be wifi on a long train ride and it turns out that there actually |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python | |
""" | |
>>> list(unrollSpiral( [[ 1, 2 ], | |
... [ 3, 4 ], | |
... [ 5, 6 ]])) | |
[1, 2, 4, 6, 5, 3] | |
>>> list(unrollSpiral( [[ 1, 2, 3], | |
... [ 4, 5, 6]])) | |
[1, 2, 3, 6, 5, 4] | |
>>> list(unrollSpiral( [[ 1, 2, 3], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"timekeeperville is a game where you must keep time" | |
# by Leif Ryge, September 2012, WTFPL | |
from time import time | |
from collections import deque | |
results = [] | |
while True: | |
adj = raw_input("Use default settings? [Yn] ") == "n" | |
bpm = int(adj and raw_input("Initial BPM? [120] ") or 120) | |
level = int(adj and raw_input("Initial level? [1] ") or 1 ) | |
limit = int(adj and raw_input("Initial time limit? [15] ") or 15 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Wolfram 1-dimensional cellular automata | |
""" | |
__author__ = "Leif Ryge" | |
__license__ = "WTFPL" | |
import sys | |
if len(sys.argv) != 4: | |
print "Usage: %s rule width count" % (sys.argv[0],) |