This file contains hidden or 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 | |
"""DCPU-16 disassembler. | |
Run as parse.py /path/to/dcpufile. | |
http://0x10c.com/doc/dcpu-16.txt | |
""" | |
import sys |
This file contains hidden or 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 | |
"""Dump reddit links. | |
Run me as something like | |
./dumpredditlinks http://www.reddit.com/user/self/submitted/.json | |
./dumpredditlinks http://www.reddit.com/r/programming | |
./dumpredditlinks \ | |
http://www.reddit.com/r/compsci \ | |
http://www.reddit.com/r/apple |
This file contains hidden or 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
// listen for a connection | |
// read what they type, and echo it back | |
// when they type "quit", close the connection. | |
package main | |
import ( | |
"bufio" | |
"fmt" | |
"net" | |
"os" |
This file contains hidden or 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
CFLAGS= -I. | |
PROG= inform6 | |
SRCS= arrays.c asm.c bpatch.c chars.c directs.c errors.c expressc.c expressp.c \ | |
files.c inform.c lexer.c linker.c memory.c objects.c states.c symbols.c \ | |
syntax.c tables.c text.c veneer.c verbs.c | |
OBJS= ${SRCS:.c=.o} | |
all: $(PROG) | |
clean: |
This file contains hidden or 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 | |
"""Store messages in a Maildir into a couchdb database.""" | |
import couchdb | |
from email.header import decode_header | |
from email.utils import parseaddr, getaddresses | |
import logging | |
from mailbox import Maildir | |
from optparse import OptionParser | |
import os |
This file contains hidden or 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
;; example function to call | |
(defun underline-char (char-point) | |
(add-text-properties char-point (1+ char-point) | |
'(face underline))) | |
(defun do-high-ascii (fn) | |
(interactive "aFunction: ") | |
(save-excursion | |
(goto-char (point-min)) | |
(while (< (point) (point-max)) |
This file contains hidden or 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
def utf8decode(thing): | |
"""Try to convert from ASCII to UTF-8.""" | |
try: | |
return thing.decode('utf-8') | |
except UnicodeDecodeError, _exc: | |
# many badly created messages will be like this | |
try: | |
return thing.decode('iso-8859-15') | |
except UnicodeDecodeError, exc: |
This file contains hidden or 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 | |
"""Store messages in a Maildir into a couchdb database.""" | |
import couchdb | |
from mailbox import Maildir | |
from optparse import OptionParser | |
import os | |
from pprint import pprint | |
import sys | |
from uuid import uuid4 |
This file contains hidden or 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 | |
"""Get title/author for ISBNs in a Google Docs spreadsheet.""" | |
from getpass import getpass | |
import os | |
import os.path | |
import sys | |
from gdata.spreadsheet import service, SpreadsheetsList | |
from gdata.books import service as bservice |