Skip to content

Instantly share code, notes, and snippets.

View zer0her0's full-sized avatar

Andrew M zer0her0

View GitHub Profile
@zer0her0
zer0her0 / nes2ardu.ino
Created September 24, 2011 21:56
NES to Arduino
/*
Reading a NES Controller
By Sebastian Tomczak
21 July 2007
Adelaide, Australia
bit 7 = A
bit 6 = B
bit 5 = select
bit 4 = start
//void setup() {
size(480, 480);
background(255, 255, 255); //(255, 255, 233)
smooth();
//}
//void draw() {
int ra1;
int ra2;
int ra3;
@zer0her0
zer0her0 / live_video.html
Created March 13, 2012 15:31
simple live video from webcam
<html>
<video autoplay></video>
<script>
var videoTag = document.querySelector("video");
navigator.webkitGetUserMedia("video,audio",
function(stream) {
var url = webkitURL.createObjectURL(stream);
videoTag.src = url;
}
@zer0her0
zer0her0 / corrupt.pde
Created April 1, 2012 15:58
Image Corruption in Processing...
// Coded initially in 2004 Benjamin Gaulon corrupt.recyclism.com // more info on www.recyclism.com //
// Feel free to use / modify / Share this //
PImage img;
String fileName = "test"; // You file name here (should be in the DATA Folder)
String fileExt = ".jpg"; // file extansion (works best with JPG or PNG)
void setup(){
size(950,150);
byte b[] = loadBytes(fileName + fileExt);
@zer0her0
zer0her0 / gist:2578863
Created May 2, 2012 18:13
clear as crystal
WONKA: Wrong, sir, wrong! Under Section Thirty-Seven B of
the contract signed by him it states quite clearly that all
offers shall become null and void if--and you can read it
for yourself in this photostatic copy: "I, the undersigned,
shall forfeit all rights, privileges, and licenses herein
and herein contained, et cetera, et cetera . . . fax mentis
incendium gloria culpum, et cetera, et cetera . . . memo bis
punitor delicatum!" It's all there, black and white, clear
as crystal!
@zer0her0
zer0her0 / gist:2586741
Created May 3, 2012 15:52
This is my rifle...
Recruits: [chanting] This is my rifle. There are many others like it, but this one is mine.
My rifle is my best friend. It is my life. I must master it as I must master my life.
Without me, my rifle is useless. Without my rifle, I am useless. I must fire my rifle true.
I must shoot straighter than my enemy, who is trying to kill me. I must shoot him before he
shoots me. I will. Before God I swear this creed: my rifle and myself are defenders of my
country, we are the masters of our enemy, we are the saviors of my life. So be it, until
there is no enemy, but peace. Amen.
<html><head><script type="text/javascript" src="http://www.google.com/friendconnect/script/rpc_relay.js"></script></head></html>
@zer0her0
zer0her0 / node_processjs.js
Created September 5, 2012 16:13
processing js node connections
/*
PROCESSINGJS.COM HEADER ANIMATION
MIT License - F1lT3R/Hyper-Metrix
Native Processing Compatible
*/
// Set number of circles
int count = 20;
// Set maximum and minimum circle size
int maxSize = 100;
@zer0her0
zer0her0 / morse.c
Created October 23, 2012 14:42
Morse code stuff.
/*
switch (tweet[i]) {
case 'A':
//do something when var equals A
morseTweet[i][9] = ".-";
break;
case 'B':
morseTweet[i] = "-...";
//do something when va9r equals B
break;
@zer0her0
zer0her0 / gist:4061989
Created November 12, 2012 21:23
Arduino Wifi shield code
#include <WiFi.h>
char ssid[] = "yourNetwork"; // your network SSID (name)
char pass[] = "12345678"; // your network password
int status = WL_IDLE_STATUS; // the Wifi radio's status
void setup() {
// initialize serial:
Serial.begin(9600);