Skip to content

Instantly share code, notes, and snippets.

@kanzure
kanzure / droid2png.sh
Created July 25, 2011 22:39
droid2png - capture screenshots of your android progress
#!/bin/bash
#file: droid2png.sh
#author: Bryan Bishop <kanzure@gmail.com>
#date: 2011-04-07
#license: gplv2+
#url: http://heybryan.org/
#example: http://heybryan.org/shots/2011-04-11-212956-hopper-progress.gif
if [[ "$1" == "" ]]; then echo "missing argument (output filename, .png)"; exit; fi;
@kanzure
kanzure / markdownify.md
Created August 1, 2012 23:08
testing mediawiki2markdown output

DIYbio FAQ v1.5: "The biohacker's FAQ"

The openwetware html was passed through markdownify to generate this document.

This FAQ for DIYbio is actively maintained by it's editors, and by you! Edit your contributions directly or email updates to the DIYbio email list, diybio@googlegroups.com.
Major contributors (in alphabetical order):
@kanzure
kanzure / androtyper.py
Created November 20, 2012 19:11
Fast keyboard input to Android from your development machine
#!/usr/bin/env monkeyrunner
import sys
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
print "Waiting for device..."
device = MonkeyRunner.waitForConnection()
print "Getting input arguments..."
input_text = sys.argv[1]
@kanzure
kanzure / webkit-inspector-shell.coffee
Created December 22, 2012 09:53
proof of concept for a command-line interface to the webkit inspector
#!/usr/bin/env node
#
# Proof of concept for accessing the WebKit Inspector from the shell. This
# traverses the DOM and dumps the raw HTML. A more sophisticated demo might
# allow you to inject javascript into the page. Also, this works with phantomjs
# out of the box.
#
# things to install:
# google-chrome --remote-debugging-port=9222 https://gmail.com/
# npm install traverse request ws
@kanzure
kanzure / stats.py
Last active December 10, 2015 05:58
base stats dumper for pokecrystal
# http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_base_stats_data_structure_in_Generation_II
from crystal import load_rom
from pokemon_constants import pokemon_constants
rom = load_rom()
basestats = 0x51424
len_mon = 0x20
spacing = "\t"
@kanzure
kanzure / cake.py
Created January 4, 2013 08:08
happy cake day to me?
lines = {
11: " / ; ,-, \\_> <<_' ____________;_)",
7: " | | .--| |,~~~~~| |~~~,,,,'-| |",
3: " ( Y Y ( )",
9: " .| |~ // ___ '-',,'.",
15: " | '-._ ~~,,, ,,,~~ __.-'~ | |",
13: " | ; '-'\_\/> '-._ |",
20: " \ `'==========='` .'",
2: " ( ) ( ) (",
8: " | |-,,~~'-'___ '-' ~~| |._",
@kanzure
kanzure / greasemonkey-springerlink-downloader.js
Created January 15, 2013 02:01
greasemonkey-springerlink-downloader
@kanzure
kanzure / sciencemag.sh
Created January 16, 2013 21:57
sciencemag.org downloader
#!/usr/bin/perl
# Scraper for Science Magazine
# Needs curl and grep and mkdir
# Just use it on Linux
# Downloads paper and all available supplementary data
# including movies and tables
# Also downloads Table of Contents for each issue
# Should store all the data properly so one can browse from
# each TOC
@kanzure
kanzure / sample.py
Last active December 11, 2015 16:58
spectrometer
class Spectrometer:
def read(self):
"""
Reads the data from the last capture.
"""
raise NotImplementedError("This must be implemented by the subclass.")
def detect(self):
"""
Returns whether or not this type of spectrometer seems to be present.
@kanzure
kanzure / README.md
Created February 1, 2013 01:59
python-rompatcher-readme

Rompatcher

Rompatcher is a python library for "patching" ROMs. It allows you to write (in a config file you can share) exactly what changes you want to make to a ROM. When you run the file, the changes are executed. The output is a usable ROM.

Installing

Simple.

sudo pip install rompatcher