Skip to content

Instantly share code, notes, and snippets.

#include <signal.h>
#include <stdio.h>
#include <string.h>
#include <pthread.h>
#include <sys/time.h>
#include <interface/mmal/mmal.h>
#include <interface/mmal/util/mmal_util.h>
@jvcleave
jvcleave / VideoSource.h
Created July 7, 2014 18:27
VideoSource
#pragma once
#include "ofMain.h"
class VideoSource
{
public:
ofVideoGrabber camera;
ofVideoPlayer videoPlayer;
// Records a local webcam feed and converts the recording to SWF.
import flash.display.BitmapData;
import flash.display.Bitmap;
import flash.display.Loader;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.geom.Rectangle;
import flash.media.Camera;
import flash.media.Video;
@jvcleave
jvcleave / gist:1558681
Created January 4, 2012 05:46
populate ofxSimpleGuiToo ComboBox with files
int fileID = 0;
vector<string> fileNames;
string fileExtension = "pex";
//
ofDirectory dir = ofToDataPath("", true);
dir.listDir();
vector<ofFile> files = dir.getFiles();
for(int i=0; i<files.size(); i++)
@kylemcdonald
kylemcdonald / ofxGlobalUtils.h
Created June 22, 2012 21:24
openFrameworks utilities for working with the mouse and screen even when an app does not have focus
#pragma once
#include "ofGraphics.h"
#include "ofImage.h"
class ofGlobalListener {
public:
ofGlobalListener();
virtual void globalMouseDown(float x, float y) = 0;
};
@roxlu
roxlu / Binnin2D.h
Created June 26, 2012 22:41
Simple templated 2D particle binning
#ifndef ROXLU_BINNING_2DH
#define ROXLU_BINNING_2DH
#include <math.h>
#include <vector>
using std::vector;
/*
@roxlu
roxlu / LightRays.cpp
Created July 16, 2012 19:04
Light Rays
#include "LightRays.h"
#include <roxlu/opengl/Error.h>
LightRays::LightRays()
:w(0)
,h(0)
,tex(0)
,fbo(0)
,depth_buffer(0)
,frag_shader(0)
// This makes relative paths work in C++ in Xcode by changing directory to the Resources folder inside the .app bundle
// this way you can include your images in the copy phase of the project and don't have to rely on a data/ folder for distribution
#ifdef TARGET_OSX
ofDisableDataPath();
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(mainBundle);
char path[PATH_MAX];
CFURLGetFileSystemRepresentation(resourcesURL, TRUE, (UInt8 *)path, PATH_MAX);
CFRelease(resourcesURL);
@mazbox
mazbox / gist:3313248
Created August 10, 2012 10:26
unrolled normalized penner equations
#ifndef PI
# define PI 3.14159265358979
#endif
inline float easeInBack(float t) {
float s = 1.70158f;
return t*t*((s+1)*t - s);
}
@beshkenadze
beshkenadze / 1_netatalk-3-install-on-debian-7
Last active October 13, 2015 13:38 — forked from vena/gist:2856490
Netatalk 3 installation procedure (Ubuntu 12.04.2 LTS/Debian 7)
$ tar xvf netatalk-3.0.5.tar.bz2
$ cd netatalk-3.0.5
$ ./configure \
--with-init-style=debian \
--with-cracklib \
--without-libevent \
--with-pam-confdir=/etc/pam.d \
--with-dbus-sysconf-dir=/etc/dbus-1/system.d
$ checkinstall --pkgname=netatalk-3.x --pkgversion="$(date +%Y%m%d%H%M)" --backup=no --deldoc=yes --default --fstrans=no