Skip to content

Instantly share code, notes, and snippets.

@sansumbrella
sansumbrella / ProjectSetup.md
Last active Apr 3, 2021
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 / build_for_tvos.sh
Last active Mar 16, 2021
Build OpenCV3 for tvos
View build_for_tvos.sh
#!/bin/bash
# Place this file adjacent to opencv and you should be able to build for tvos.
# The OpenCV CMakeLists.txt file is pretty huge, but it is well organized,
# so if you need to make changes, consult what options there are in that file.
# A whole bunch of compiler tests fail, but that doesn't seem to matter.
#
# After this runs CMake, you will want to build the binaries and install the headers.
# $ make -j 8
# $ make install
#
@sansumbrella
sansumbrella / EventDispatcher.cpp
Created Aug 3, 2009
C++ observer pattern for event handling.
View EventDispatcher.cpp
#include "EventDispatcher.h"
void EventDispatcher::addListener( Listener *l )
{
mListeners.push_back(l);
}
void EventDispatcher::removeListener( Listener *l )
{
mListeners.erase( std::remove( mListeners.begin(), mListeners.end(), l ), mListeners.end() );
@sansumbrella
sansumbrella / create-sparsebundle.sh
Created Nov 1, 2012
Sparse bundle creation for time machine on NAS.
View create-sparsebundle.sh
# creates a sparsebundle disk image with a 128MB band size
MACHINE_NAME=your-machine-name
echo $MACHINE_NAME
hdiutil create -size 900g -type SPARSEBUNDLE -nospotlight -volname "Backup of $MACHINE_NAME" -fs "Case-sensitive Journaled HFS+" -imagekey sparse-band-size=262144 -verbose ./$MACHINE_NAME.sparsebundle
@sansumbrella
sansumbrella / LICENSE
Last active Jun 11, 2020
Reaction Diffusion Simulation in GLSL
View LICENSE
/*
* Copyright (c) 2016 David Wicks, sansumbrella.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
@sansumbrella
sansumbrella / MapboxMap.css
Last active Sep 27, 2019
Copy of the Mapbox data-driven-lines sample using React+Hooks
View MapboxMap.css
.mapbox-map {
min-height: 100%;
width: 100%;
position: fixed;
top: 0;
left: 0;
}
@sansumbrella
sansumbrella / index.html
Last active Jun 21, 2019
Pickable 3D buildings with feature state and buildings plus
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Highlight 3D Building By ID</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.53.0/mapbox-gl.js"></script>
<link href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.53.0/mapbox-gl.css" rel="stylesheet" />
<style>
body {
@sansumbrella
sansumbrella / query-sparsebundle-band-size.sh
Created Nov 4, 2012
Query band size of a sparsebundle (also accessible in Info.plist of bundle)
View query-sparsebundle-band-size.sh
# find out how big the sparse-band-size is in a mounted volume
hdiutil info -verbose | grep band-size
# default Time Machine sparsbundle virtual-band-size = 16384 (8MB)
# create-sparsebundle's virtual-band-size = 262144 (128MB)
@sansumbrella
sansumbrella / PolygonShapes.cpp
Created Aug 12, 2011
Basic Shapefile to Shape2d
View PolygonShapes.cpp
/*
* PolygonShapes.cpp
* HereToThere
*
* Created by David Wicks on 2/23/11.
* Copyright 2011 David Wicks. All rights reserved.
*
*/
#include "PolygonShapes.h"