Skip to content

Instantly share code, notes, and snippets.

View tkdave's full-sized avatar

David Knape tkdave

View GitHub Profile
@tkdave
tkdave / gist:4150916
Created November 26, 2012 21:58
Installing OpenCV python libs on mac to work with virtualenv and brew
# Installing OpenCV python libs on mac to work with virtualenv
# OpenCV 2.4.3
# Python 2.7.3 installed with brew
# assuming you have virtualenv, pip, and python installed via brew
# assuming $WORKON_HOME is set to something like ~/.virtualenvs
# using homebrew - make sure we're current
brew update
@tkdave
tkdave / Util.php
Created September 13, 2012 21:07
PHP4 upload handler
<?php
class Bumpslide_Util
{
static public function CreatePath( $path ) {
$folders=explode('/',$path);
$existingPath= (($os = getenv('OS')) && (substr_count($os, 'Win')>0)) ? '' : '/';
foreach($folders as $folder){
if($folder=='') continue;
@tkdave
tkdave / DBConnection.php
Created February 9, 2012 22:22
Memcache-backed MySQL Database connection class.
<?php
/**
* Lazy Database connection class - API version
*
* The database is not actually opened until we execute a query
*
* @author David Knape
*/
class DBConnection
# Find all un-added files and add them to svn
svn status | awk '{if ($1=="?") print $2}' | xargs svn add
# Find all deleted files and delete them from svn
svn status | awk '{if ($1=="!") print $2}' | xargs svn del
@tkdave
tkdave / quickbuild
Created June 13, 2010 07:34
MXMLC build script written in Ruby that extracts MXMLC command line parameters from the @mxmlc javadoc tag inside the AS3 file
#!/usr/bin/ruby
##
# MXMLC Quickbuild Script v.2010-06-13
#
# Based on the Quickbuild feature found in FlashDevelop:
# http://www.flashdevelop.org/wikidocs/index.php?title=QuickBuild
#
# Author:
# David Knape, http://www.bumpslide.com/