Skip to content

Instantly share code, notes, and snippets.

@heisters
heisters / basic_ufw.sh
Created June 11, 2009 17:38
A basic UFW firewall configuration
ufw default deny
ufw allow ssh/tcp
ufw limit ssh/tcp
ufw allow http/tcp
ufw allow https/tcp
ufw logging on
ufw enable
ufw status
@heisters
heisters / Solarized High Contrast Dark.itermcolors
Created June 8, 2011 21:49
Solarized High Contrast Dark theme for iTerm2
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.19370138645172119</real>
<key>Green Component</key>
<real>0.15575926005840302</real>
@heisters
heisters / cv_median.cpp
Created June 18, 2015 22:38
Find the median of a single channel using OpenCv
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 / BlurFilter.cpp
Last active July 10, 2020 10:56
Cinder blur filter
#include "BlurFilter.h"
#include "Resources.h"
using namespace std;
using namespace ci;
BlurFilter::BlurFilter( int w, int h ) :
mFboA( w, h ),
mFboB( w, h )
@heisters
heisters / bdd.vim
Created December 30, 2009 20:08
Run RSpec and Cucumber from vim, on the current spec/feature
" Vim functions to run RSpec and Cucumber on the current file and optionally on
" the spec/scenario under the cursor. Within the context of a Rails app, will
" prefer script/spec and script/cucumber over their system counterparts.
function! RailsScriptIfExists(name)
" Bundle exec
if isdirectory(".bundle") || (exists("b:rails_root") && isdirectory(b:rails_root . "/.bundle"))
return "bundle exec " . a:name
" Script directory
elseif exists("b:rails_root") && filereadable(b:rails_root . "/script/" . a:name)
return b:rails_root . "/script/" . a:name
@heisters
heisters / UILogger.h
Created February 17, 2017 19:21
Custom Cinder logger for use with ImGui
#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 / gem_logout.sh
Created March 16, 2011 18:41
Logout of rubygems.org. Hecka hacky.
ruby -e "Gem.configuration.rubygems_api_key = nil"
@heisters
heisters / DeferredRenderer.cpp
Last active November 14, 2017 08:18
Deferred Renderer for Cinder (glNext)
#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 / Config.cpp
Last active April 18, 2017 23:02
Cinder class for managing configuration with defaults, a UI, and persistence
#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 ) )
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.