Skip to content

Instantly share code, notes, and snippets.

@heisters
heisters / UILogger.h
Created Feb 17, 2017
Custom Cinder logger for use with ImGui
View UILogger.h
#pragma once
#include "cinder/Log.h"
#include "CinderImGui.h"
namespace ImGui {
class Logger : public ci::log::Logger {
private:
ImGuiTextBuffer m_buffer;
ImGuiTextFilter m_filter;
@heisters
heisters / hash_manager.js
Created Jan 26, 2016
Simple window hash URL navigation
View hash_manager.js
(function( exports ) {
var onDOMReady = function( fn ) {
if ( document.readyState !== 'loading' ) {
fn();
} else {
document.addEventListener( "DOMContentLoaded", fn );
}
};
exports.onDOMReady = onDOMReady;
View keras-char-rnn.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@heisters
heisters / cv_median.cpp
Created Jun 18, 2015
Find the median of a single channel using OpenCv
View cv_median.cpp
namespace cv {
// calculates the median value of a single channel
// based on https://github.com/arnaudgelas/OpenCVExamples/blob/master/cvMat/Statistics/Median/Median.cpp
double median( cv::Mat channel )
{
double m = (channel.rows*channel.cols) / 2;
int bin = 0;
double med = -1.0;
int histSize = 256;
@heisters
heisters / pbhi.sh
Created May 26, 2015
Add syntax highlighting to the current pastebuffer
View pbhi.sh
#!/bin/bash
# brew install highlight
pbpaste | highlight --syntax bash -k 'Andale Mono' -s molokai -O rtf | pbcopy
@heisters
heisters / DeferredRenderer.cpp
Last active Nov 14, 2017
Deferred Renderer for Cinder (glNext)
View DeferredRenderer.cpp
#include "DeferredRenderer.h"
#include "cinder/gl/gl.h"
#include "cinder/Log.h"
#include "cinder/Buffer.h"
#include "DeferredRendererShaders.h"
#include "DeferredRenderer_random_png.h"
using namespace ci;
using namespace std;
@heisters
heisters / gifify.sh
Created Mar 26, 2015
Convert videos to gifs
View gifify.sh
#!/bin/bash
in="$1"
out="$2"
fps=6
delay=$(printf "%0.f" $(echo "scale=2;100 / $fps" | bc))
mkdir gif
cd gif
ffmpeg -i $in -r $fps frame%05d.png
@heisters
heisters / three.orbitcontrols.js
Last active Aug 29, 2015
Orbit Controls for THREE.js
View three.orbitcontrols.js
/**
* @author qiao / https://github.com/qiao
* @author mrdoob / http://mrdoob.com
* @author alteredq / http://alteredqualia.com/
* @author WestLangley / https://github.com/WestLangley
*/
THREE.OrbitControls = function ( object, domElement ) {
THREE.EventDispatcher.prototype.apply( this );
@heisters
heisters / Config.cpp
Last active Apr 18, 2017
Cinder class for managing configuration with defaults, a UI, and persistence
View Config.cpp
#include "Config.h"
#include "cinder/app/App.h"
#include <boost/algorithm/string.hpp>
using namespace std;
using namespace ci;
Config::Config( const ci::fs::path &path ) :
mPath( path ),
mJson( app::loadAsset( path ) )
@heisters
heisters / BlurFilter.cpp
Last active Jul 10, 2020
Cinder blur filter
View BlurFilter.cpp
#include "BlurFilter.h"
#include "Resources.h"
using namespace std;
using namespace ci;
BlurFilter::BlurFilter( int w, int h ) :
mFboA( w, h ),
mFboB( w, h )
You can’t perform that action at this time.