Skip to content

Instantly share code, notes, and snippets.

View tonetheman's full-sized avatar

Tony Colston tonetheman

View GitHub Profile
@tonetheman
tonetheman / build.xml
Created October 22, 2011 14:23
ant build file for MyBot.java that comes in the starter pack aichallenge
<project name="mybot" basedir=".">
<path id="cp">
<pathelement path="${basedir}" />
</path>
<echo>deleting old jar file...</echo>
<delete file="MyBot.jar" />
<echo>deleting class files...</echo>
@tonetheman
tonetheman / goog.sh
Created May 4, 2012 15:14
install google play on android emulator
# got this from this page
# put this here so i would not lose it!
# http://www.piotrbuda.eu/2012/05/installing-google-play-on-android.html
# command to start emulator
# the important thing is the 200 need more space on system
emulator -avd am -partition-size 200 -no-audio -no-boot-anim
# now the loading of the apks
adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock0 /system
@tonetheman
tonetheman / fake.js
Created May 13, 2012 04:56
javascript to rotate image on html page
// see this page
// http://www.kavoir.com/2009/08/css-rotate-text-image-elements-by-90-180-or-270-degrees.html
// here is the javascript
// 1. get the element
// 2. get the style
// 3. get the webkitTransform and assign it a value of the rotation degree you want
document.getElementsByTagName("img")[0]
@tonetheman
tonetheman / http_debugging.py
Created August 22, 2012 00:16
how to debug a urllib.urlopen in python!
import urllib
import httplib
httplib.debuglevel = 1
httplib.HTTPConnection.debuglevel = 1
u = urllib.urlopen("http://yahoo.com")
data = u.read()
u.close()
@tonetheman
tonetheman / test_screenshots.py
Created August 29, 2012 21:23
testing a screenshot run
import urllib, urllib2, httplib, base64, json, time
class CBTAPI:
def setup_auth(self):
self.b64string = base64.encodestring("%s:%s" %
(self.username, self.password))
self.b64string = self.b64string.replace("\n","")
def add_auth(self, req):
req.add_header("Authorization", "Basic %s" % self.b64string)
def __init__(self, username, password):
@tonetheman
tonetheman / wow_onefile.php
Created October 19, 2012 01:42
file to pull one API from wow armory
<!DOCTYPE HTML>
<html>
<head>
</head>
<body>
<form action="wow_onefile.php" method="POST">
<label>realm name</label>
<input type="text" size="30" name="realm" id="realm">
@tonetheman
tonetheman / CowTester.java
Created February 22, 2013 20:44
cow serializer
package moo;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
public class CowTester {
@tonetheman
tonetheman / Crud.java
Created April 10, 2013 21:20
Java file to show when paintComponent is being called.
import java.awt.*;
import javax.swing.*;
class DrawPanel extends JPanel {
public void paintComponent(final Graphics g) {
System.out.println("paintComponent called now!");
}
}
@tonetheman
tonetheman / simple_bucket.js
Created April 21, 2013 00:47
penutty - simple bucket solution
Peanutty.loadLevel()
peanutty.wait(1000)
peanutty.createBall
x: 365.23741007194246
y: 421.705035971223
radius: 20
static: false
peanutty.wait(2000)
level.fireCannon
@tonetheman
tonetheman / small.py
Last active December 16, 2015 23:30
git to make a super small pdf
EOL = "\x0d\x0a"
class PDFMaker:
def __init__(self, filename):
self.outf = open(filename,"wb")
self.pos = 0
self.trans = []
self.objs = []
def incpos(self, size):
self.pos = self.pos + size