Skip to content

Instantly share code, notes, and snippets.

View paultag's full-sized avatar

Paul Tagliamonte paultag

View GitHub Profile
#!/usr/bin/env python
from opencv.cv import *
from opencv.highgui import *
cvNamedWindow("w1", CV_WINDOW_AUTOSIZE)
capture = cvCreateCameraCapture(0)
def calculate( image ):
greyscale = cvCreateImage(cvSize(image.width, image.height), 8, 1)
/*
* "Throb" effect.
*
* Paul Tagliamonte, 2010.
*
* This is a re-take on the classic "pulse" ( otherwise
* known as the standby, throb, blob, mob or rob effect )
*
* Yes, that was a joke. Lighten up, this is programming.
*
@paultag
paultag / throbber_deux.this.is.not.c
Created October 26, 2010 06:59
Throbber ( Take Deux )
/*
* "Throb" effect ( Part Deux )
*
* Paul Tagliamonte, 2010. ( Peace, Love and C++, baby )
*
* This code is released under the Bacon license.
* If you like this code enough, consider sending me bacon.
*
* That or GPL-3+.
*
@paultag
paultag / rgb_throb.this.is.not.c
Created October 31, 2010 22:41
The RGB Throbber
/*
* "Throb" effect ( Part Deux )
*
* Paul Tagliamonte, 2010. ( Peace, Love and C++, baby )
*
* This code is released under the Bacon license.
* If you like this code enough, consider sending me bacon.
*
* That or GPL-3+.
*
@paultag
paultag / gol.c
Created February 22, 2011 06:07
Goofy Game of Life impl
#include <iostream>
#include <limits.h>
#include <math.h>
using namespace std;
int WORLD = 0;
int LASTWORLD = 0;
int NEWWORLD = 0;
@paultag
paultag / huzzah!
Created August 22, 2011 15:29
tarball generator
#!/bin/bash
BUILD_DIR=/var/builds
GNUPG_KEY=DBC1F58D
MIRRORDIR=/git/
WORKDIR=/tmp/$$.d/
echo "Creating workdir: $WORKDIR"
mkdir $WORKDIR
@paultag
paultag / gist:1313020
Created October 25, 2011 14:55
clear the screen in c++
#include <iostream>
using namespace std;
int main ( int argc, char ** argv ) {
char msg[] = {
0x1B, '[', '2', 'J', 0x1B, '[', 'H', '\0'
};
std::cout << msg;
}
@paultag
paultag / debwatch
Created November 28, 2011 14:58
Debian Changes via CLI :)
#!/usr/bin/env python
import time
import urllib
import json
service = "http://pault.ag:8080/tail"
lastts = 0
def loop():
@paultag
paultag / nyangif.py
Created December 4, 2011 15:49
Nyangifer
#!/usr/bin/env python
import Image
import time
import socket
import struct
import sys
import colortrans
def printPix( color ):
@paultag
paultag / color-wave.js
Created March 30, 2012 00:44
tri-color led wave
var Board = require('../lib/firmata').Board;
valMin = 0;
valMax = 2 * (3.141592654);
valCur = 0.0;
step = 0.1;
oscl_mult = (255/2);
leds = [ 9, 10, 11 ];