Skip to content

Instantly share code, notes, and snippets.

View load_movie_async_crash.cpp
qtime::MovieGlRef loadMovie( const ci::gl::ContextRef &context, const ci::fs::path &path ) {
ci::ThreadSetup thread_setup;
try {
auto movie = qtime::MovieGl::create(path);
return movie;
catch( std::exception &exc ) {
CI_LOG_E( "Error loading texture: " << exc.what() );
return nullptr;
sansumbrella / gist:fae0ca475a5c965e6e06
Created Jan 26, 2015
Sublime Text 2 Keybindings Preferences
View gist:fae0ca475a5c965e6e06
// match XCode switch file key binding
{ "keys": ["super+ctrl+up"], "command": "switch_file", "args": {"extensions": ["cpp", "cxx", "cc", "c", "hpp", "hxx", "h", "ipp", "inl", "m", "mm"]} }
, { "keys": ["super+ctrl+down"], "command": "switch_file", "args": {"extensions": ["cpp", "cxx", "cc", "c", "hpp", "hxx", "h", "ipp", "inl", "m", "mm"]} }
// move line like XCode
, { "keys": ["super+option+["], "command": "swap_line_up" }
, { "keys": ["super+option+]"], "command": "swap_line_down" }
sansumbrella /
Last active Aug 29, 2015
Letter to Intel

The reason I'm writing today is the decision, relayed by your customer support team, to pull advertising for Intel RealSense Technology from the online publication for game industry professionals,

I am very disappointed in your response to important cultural criticism that is driving our field forward. It is especially dismaying that you would pull support from the site on the basis of a single article and the complaints of a small, bigoted group.

The writing of critics such as Leigh Alexander, Mattie Brice, Robert Yang, and Anita Sarkeesian is essential to the growth of the gaming and computing industry and vital to our wider cultural discourse. It is shameful that a major corporation would run away from this discourse, especially if it purports to be interested in developing the technologies of the future.

The technologies of the future are inherently bound up in the culture of the future. They do not exist apart from racism, sexism, and classism. By pretending that technology can be separ

View CameraTestApp.cpp
#include "cinder/app/AppNative.h"
#include "cinder/gl/gl.h"
#include "cinder/Camera.h"
#include "cinder/params/Params.h"
using namespace ci;
using namespace ci::app;
using namespace std;
sansumbrella /
Last active Apr 3, 2021
Brief instructions for project setup using submodules.

Instructions for project setup using submodules.


# Add Cinder and Soso submodules, specifying the branches we want
git submodule add -b release --name Cinder lib/Cinder
git submodule add -b cinder --name Soso lib/ofxSoso
sansumbrella / circular.cpp
Last active Dec 23, 2015
Sample showing use of forward declarations to handle circular dependencies. Also note the use of weak_ptr to break circular references (which would leak).
View circular.cpp
#include <iostream>
#include <memory>
using namespace std;
Demonstration of circular dependencies broken with forward declarations.
Compile like so:
clang++ -std=c++11 -stdlib=libc++ circular.cpp -o build/circular && build/circular
sansumbrella /
Last active Dec 20, 2015
Script to start a local server in the current directory. Basically a fancy SimpleHTTPServer, in that it's accessible by other devices on your LAN and it prints out the server address on startup.
#! /usr/bin/python
# Server config:
# IP address:
import socket
import BaseHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
# Announce the IP address and port we will serve on
port = 8000
print("Serving on %s:%s") % (socket.gethostbyname(socket.getfqdn()), port)
sansumbrella / Facade.h
Created May 17, 2013
C++ facade for Objective-C class
View Facade.h
// In your .h file:
#ifdef __OBJC__
@class ImplementationClass;
class ImplementationClass;
class Facade
sansumbrella / OrientationProjectApp.cpp
Last active Dec 12, 2015
Rotating UI elements while maintaining physical location. Compile as Objective-C++ against the AppRewrite branch of Cinder.
View OrientationProjectApp.cpp
#include "cinder/app/AppNative.h"
#include "cinder/gl/gl.h"
#include "cinder/Timeline.h"
#include "cinder/Rand.h"
#import <UIKit/UIView.h>
#import <UIKit/UIApplication.h>
using namespace ci;
using namespace ci::app;
using namespace std;
View debounce.js
// debounce a callback function with delay being the longest acceptable time before seeing an effect
function debounce (fn, delay) {
var timeout = null;
return function () {
if( timeout !== null ){ clearTimeout( timeout ); }
timeout = setTimeout( fn, delay );
// example use: