Skip to content

Instantly share code, notes, and snippets.

@sansumbrella
sansumbrella / CameraTestApp.cpp
Created September 3, 2014 20:14
Roll/Pitch/Yaw weird
#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 / IntelJFC.md
Last active August 29, 2015 14:07
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, 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

@sansumbrella
sansumbrella / gist:fae0ca475a5c965e6e06
Created January 26, 2015 18:22
Sublime Text 2 Keybindings Preferences
[
// 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" }
]
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 / image_load_timing.cpp
Last active August 29, 2015 14:18
Test of async and synchronous image load timing in Cinder.
#include "cinder/app/App.h"
#include "cinder/app/RendererGl.h"
#include "cinder/gl/gl.h"
#include "cinder/gl/Texture.h"
using namespace ci;
using namespace ci::app;
using namespace std;
struct TextureInfo {
@sansumbrella
sansumbrella / Hosting Git repositories on DreamHost
Created May 7, 2009 21:24
Bash script to create and initialize a git repo on a dreamhost server
#Based on:
#http://casperfabricius.com/site/2008/09/21/keeping-git-repositories-on-dreamhost-using-ssh/
DREAMGIT_DOMAIN=you@yourhost.dreamhost.com
GIT_DOMAIN=whatever.you.want
DH_USER=home/yourusername
YEAR=`eval date +%Y`
#set up on the server
ssh $DREAMGIT_DOMAIN 'mkdir -p '$GIT_DOMAIN'/'$YEAR'/'$1'.git && cd '$GIT_DOMAIN'/'$YEAR'/'$1'.git && git --bare init'
#set up locally
@sansumbrella
sansumbrella / jsonp.php
Created May 14, 2009 22:41
php to return JSON objects. Works with jQuery.
<?php
$JSON = '{events:[{title:"title", info:"info"},{title:"title", info:"info"},{title:"title", info:"info"}]}';
header("Content-type: application/json");
echo $_GET['callback']."($JSON);"
?>
@sansumbrella
sansumbrella / keyboard_save.pde
Created August 12, 2009 19:14
Processing saveFrame function.
//this is part of why processing is awesome
void keyPressed()
{
if( key == 's')
{
saveFrame("frames/Generic-####.png");
}
}
@sansumbrella
sansumbrella / Build.php
Created December 19, 2009 19:42
php static page creation
<?php
$base_url = "http://localhost/~username";
$builder = new Build($base_url);
$source = "index.php?about";
$target = "about.html";
$builder->write_file($source, $target);
Class Build
{
public $url; //base url
@sansumbrella
sansumbrella / Website_screenshots.scpt
Created February 22, 2010 17:39
Batch website screenshots using Safari
(*_*)
(* Navigates to each page and takes a screenshot *)
(* Combined a screenshot script -- http://www.macosxhints.com/article.php?story=20030115080027106 -- with some javascript *)
set save_location to (choose folder with prompt "Choose where to save screenshots")
set base_url to "http://sansumbrella.com/writing/page/"
set first_page to 1
set last_page to 5
set filename to "screenshot-"
tell application "Safari"