Skip to content

Instantly share code, notes, and snippets.

set path="C:\WINDOWS\system32;C:\usr\local\python_2-4-4\;C:\usr\local\python_2-4-4\Tools\Scripts\;"
"C:\Program Files\FontLab\Studio5\Studio5.exe"
@lamberta
lamberta / TextWithVelocity.as
Created April 16, 2010 01:08
LetterFountain.as demo
/**
* TextWithVelocity, Billy Lamberta.
* Extended textfield, with added variables to hold a velocity value.
* */
//need to put the package directory structure here
package {
import flash.text.TextField;
public class TextWithVelocity extends TextField {
#grep through files,
#search list titles which start with ':'
#replace colons with tabs
#return file name, line number, title
grep -n -e '^:.*text' ./* | sed 's/:\+/\t/g'
@lamberta
lamberta / camshifting.c
Created November 11, 2009 05:18
OpenCV example for face detection with Haar and tracking with CamShift.
#include "camshifting.h"
/* Create a camshift tracked object from a region in image. */
TrackedObj* create_tracked_object (IplImage* image, CvRect* region) {
TrackedObj* obj;
//allocate memory for tracked object struct
if((obj = malloc(sizeof *obj)) != NULL) {
//create-image: size(w,h), bit depth, channels
obj->hsv = cvCreateImage(cvGetSize(image), 8, 3);
@lamberta
lamberta / facedetect.c
Created November 10, 2009 02:23
basic OpenCV face detection
/** Basic OpenCV example for face detecion.
* Handles a still image or a video file.
**/
#include <stdio.h>
#include <cv.h>
#include <highgui.h>
void detect_faces (IplImage*, CvHaarClassifierCascade*, CvMemStorage*);
void cleanup (char*, CvHaarClassifierCascade*, CvMemStorage*);
void print_help (char*);
@lamberta
lamberta / gist:223133
Created October 31, 2009 16:14
mplayer audio boost
mplayer -af volume=20:0 mediafile
@lamberta
lamberta / .emacs
Created October 27, 2009 21:29
using a git repo as a todo list
;;add to your .emacs
(defun git-commit-file-and-push (&optional commit-msg)
"Commit current file and push to git repository."
(interactive)
(if (null commit-msg)
(setq commit-msg (read-from-minibuffer "Commit message: ")))
(if (buffer-modified-p (current-buffer))
(if (y-or-n-p "Save modified buffer? ")
(save-buffer)))
@lamberta
lamberta / 01-hello-shapes.html
Created October 25, 2009 16:13
Intro to Canvas - BuffaloLab demo
<html>
<head>
<script type="text/javascript">
function draw () {
var canvas = document.getElementById("my_canvas");
var ctx = canvas.getContext("2d");
rect(ctx);
triangle(ctx); //on square
circle(ctx); //on tri
@lamberta
lamberta / toon-shader.cl
Created October 24, 2009 23:34
cl-opengl, load toon shader
;;cl-opengl, load toon shader
(require :asdf)
(asdf:load-system :cl-opengl)
(asdf:load-system :cl-glu)
(asdf:load-system :cl-glut)
(defun file->string (path)
"Sucks up an entire file from PATH into a freshly-allocated string,
returning two values: the string and the number of bytes read."
(with-open-file (s path)
@lamberta
lamberta / gist:217730
Created October 24, 2009 20:42
vecto example - draw text, circle, line
;;vecto example
;;draw text, circle, and some lines
(require :asdf)
(asdf:load-system :vecto)
(defparameter *font* "/home/billy/.fonts/Consola.ttf")
(defun draw-it (file)
(vecto:with-canvas (:width 200 :height 200)