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
import pprint | |
import re | |
pattern = r'.*(\d*) GB \[(.*)\]' | |
example = '______|Virtual Disk: 25 GB [421451-san-fc-hlu00]' | |
vmd = [l.strip() for l in open("vmmap.txt", "r").readlines()] | |
vmm = {} | |
latch = False | |
for l in vmd: | |
if l == "": | |
latch = False |
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
import requests, json | |
from collections import Counter | |
districts = json.loads(requests.get('http://public-crest.eveonline.com/districts/').text)['items'] | |
systems = {} | |
constellations = {} | |
s_times = {} | |
c_times = {} |
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
import random | |
class GameFinished(Exception): | |
pass | |
def lrc_roll(): | |
return random.randint(0,2) | |
def finish_condition(pool): |
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
import traceback | |
def printexceptions(f): | |
def a(*args, **kwargs): | |
try: | |
return f(*args, **kwargs) | |
except: | |
traceback.print_exc() | |
return a |
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
import sys, warnings | |
def WrapMod(mod, deprecated): | |
"""Return a wrapped object that warns about deprecated accesses""" | |
deprecated = set(deprecated) | |
class Wrapper(object): | |
def __getattr__(self, attr): | |
if attr in deprecated: | |
warnings.warn("Property %s is deprecated" % attr) |
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
USERNAME = 'NAOUSERNAME' | |
PASSWORD = 'NAOPASSWORD' | |
import pexpect, traceback, sys, time | |
def scum(n): | |
try: | |
#n = pexpect.spawn('nethack') | |
print "BEGIN" | |
r = n.expect(['Shall I pick', 'Restoring save file', 'Too many hacks', 'stale' ]) |
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
""" | |
Figure out how many tengus I have to eat to get both teleportitis and teleport control. | |
Author: Craig Calef <[email protected]> | |
""" | |
import random, sys, os, pprint | |
def rn2(i): | |
return random.randint(0, i-1) |
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
/* | |
As of version 1.1.2, Propane will load and execute the contents of | |
~Library/Application Support/Propane/unsupported/caveatPatchor.js | |
immediately following the execution of its own enhancer.js file. | |
You can use this mechanism to add your own customizations to Campfire | |
in Propane. | |
Below you'll find two customization examples. |
NewerOlder