Skip to content

Instantly share code, notes, and snippets.

View benben's full-sized avatar
🤔
Are we still online?

Benjamin Knofe benben

🤔
Are we still online?
View GitHub Profile

Keybase proof

I hereby claim:

  • I am benben on github.
  • I am benbenben (https://keybase.io/benbenben) on keybase.
  • I have a public key ASCjaqLbzc-VYl5VAWcOBTKGic75PrKEFS3pUObgxnIcOAo

To claim this, I am signing this object:

# 1 "include/ruby/ruby.h"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 325 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "include/ruby/ruby.h" 2
# 24 "include/ruby/ruby.h"
# 1 ".ext/include/x86_64-darwin15/ruby/config.h" 1
# 25 "include/ruby/ruby.h" 2
arDate = 03-JAN-2013
arTime = 12:00PM
arOutTemp = 6.0
arOutTempHi = 6.0
arOutTempLo = 5.7
arRainfall = 0
arRainRateHi = 0
arBaro = 1027.630
arWindSamples = 116
arInTemp = 23.1
@benben
benben / slug.rb
Created October 17, 2012 10:53
Extracting to_param, find_one functionality out of friendly_id gem
# *****************************************
# * *
# * extracted from *
# * https://github.com/norman/friendly_id *
# * Version: 4.0.8 *
# * *
# * modified by *
# * Benjamin Knofe (github.com/benben) *
# * *
# *****************************************
/*
** The OpenGL Extension Wrangler Library
** Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
** Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
** Copyright (C) 2002, Lev Povalahev
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are met:
**
@benben
benben / meta.md
Created July 29, 2012 09:54
meta info for ofxAddonTemplate
class Quad : public ofNode {
public:
Quad(float x, float y, float z, float width, float height, float depth) {
myMesh.addVertex(ofVec3f(x+width,y,z));
myMesh.addVertex(ofVec3f(x+width,y,z-depth));
myMesh.addVertex(ofVec3f(x,y,z-depth));
myMesh.addVertex(ofVec3f(x,y,z));
myMesh.addVertex(ofVec3f(x+width,y+height,z));
myMesh.addVertex(ofVec3f(x+width,y+height,z-depth));
myMesh.addVertex(ofVec3f(x,y+height,z-depth));
@benben
benben / testApp.cpp
Created July 7, 2012 16:14
of app for twitter avatar (press space to save images, stitch it together with a gif animator)
#include "testApp.h"
//--------------------------------------------------------------
void testApp::setup(){
for (int i = 0; i <= 255; i++) {
ofColor c;
c.setHsb((i % 16) * 16, 255, i);
colors.push_back(c);
}
@benben
benben / command.rb
Created May 23, 2012 10:50
run shell commands and redirect output to stdout/stderr and seperate files stdout.log and stderr.log
require 'open3'
class MultiIO #stolen from here: http://stackoverflow.com/a/6407200/828277
def initialize(*targets)
@targets = targets
end
def write(*args)
@targets.each {|t| t.write(*args)}
@benben
benben / config.ru
Created January 27, 2012 16:45
basic ajax/sinatra example
$:.unshift File.expand_path(File.dirname(__FILE__))
require "viz"
run Sinatra::Application