Skip to content

Instantly share code, notes, and snippets.

@krolinventions
krolinventions / snakebot.js
Created May 12, 2012 22:36 — forked from thelbane/snakebot.js
Snake game solver/bot
// A bot for this silly demo: http://www.webdeveloperjuice.com/demos/jquery/snake_jquery.html
// Compile with http://closure-compiler.appspot.com/home set to Advanced Optimization
//
// Automatically runs when compiled statement is pasted into console. Type "win()" to run it again.
(window['win'] = function () {
// direction mappings
var i, dirs = ['up', 'right', 'down', 'left'],
diffs = [[-1, 0], [0, 1], [1, 0], [0, -1]]; // don't ask me why the coords are ordered [y,x]
window['t'] = 1; // next Turn direction if we hit a wall (opposite of last turn direction)
window['m'] = 1; // My internally tracked direction
@krolinventions
krolinventions / reddit-privacy.py
Created June 29, 2012 19:39 — forked from anonymous/reddit-privacy.py
Helps to ensure your privacy on reddit by cleaning up your old posts and comments. Intended to be used with cron.
#!/usr/bin/env python
# put your username and password here
USERNAME = ""
PASSWORD = ""
import urllib, urllib2, cookielib, json, sys, datetime
from optparse import OptionParser
# handle command line arguments