Skip to content

Instantly share code, notes, and snippets.

David Wicks sansumbrella

Block or report user

Report or block sansumbrella

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View load_movie_async_crash.cpp
qtime::MovieGlRef loadMovie( const ci::gl::ContextRef &context, const ci::fs::path &path ) {
ci::ThreadSetup thread_setup;
try {
context->makeCurrent();
auto movie = qtime::MovieGl::create(path);
return movie;
}
catch( std::exception &exc ) {
CI_LOG_E( "Error loading texture: " << exc.what() );
return nullptr;
@sansumbrella
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
sansumbrella / IntelJFC.md
Last active Aug 29, 2015
Letter to Intel
View IntelJFC.md

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, Gamasutra.com.

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
sansumbrella / ProjectSetup.md
Last active Aug 29, 2015
Brief instructions for project setup using submodules.
View ProjectSetup.md

Instructions for project setup using submodules.

Initialization

# Add Cinder and Soso submodules, specifying the branches we want
git submodule add -b release --name Cinder git@github.com:sosolimited/Cinder.git lib/Cinder
git submodule add -b cinder --name Soso git@github.com:sosolimited/ofxSoso.git lib/ofxSoso
@sansumbrella
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
sansumbrella / serve-me-up.py
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.
View serve-me-up.py
#! /usr/bin/python
# Server config: http://stackoverflow.com/questions/4139170/bind-httserver-to-local-ipport-so-that-others-in-lan-can-see-it
# IP address: http://stackoverflow.com/questions/166506/finding-local-ip-addresses-using-pythons-stdlib
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
sansumbrella / Facade.h
Created May 17, 2013
C++ facade for Objective-C class
View Facade.h
// In your .h file:
#ifdef __OBJC__
@class ImplementationClass;
#else
class ImplementationClass;
#endif
class Facade
{
public:
@sansumbrella
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:
You can’t perform that action at this time.