Skip to content

Instantly share code, notes, and snippets.

View smukkejohan's full-sized avatar

Johan Bichel Lindegaard smukkejohan

View GitHub Profile
@smukkejohan
smukkejohan / linear_fill.json
Created September 20, 2015 18:42
linear fill gridded frames
This file has been truncated, but you can view the full file.
[[1442749988.0, [[-46.239494999999998, 47.021937999999999, -999999.0], [-46.239494999999998, 47.176969234285714, -999999.0], [-46.239494999999998, 47.33200046857143, -999999.0], [-46.239494999999998, 47.487031702857145, -999999.0], [-46.239494999999998, 47.642062937142853, -999999.0], [-46.239494999999998, 47.797094171428569, -999999.0], [-46.239494999999998, 47.952125405714284, -999999.0], [-46.239494999999998, 48.107156639999999, -999999.0], [-46.239494999999998, 48.262187874285715, -999999.0], [-46.239494999999998, 48.41721910857143, -999999.0], [-46.239494999999998, 48.572250342857139, -999999.0], [-46.239494999999998, 48.727281577142854, -999999.0], [-46.239494999999998, 48.882312811428569, -999999.0], [-46.239494999999998, 49.037344045714285, -999999.0], [-46.239494999999998, 49.19237528, -999999.0], [-46.239494999999998, 49.347406514285716, -999999.0], [-46.239494999999998, 49.502437748571431, -999999.0], [-46.239494999999998, 49.657468982857139, -999999.0], [-46.239494999999998, 49.812500217142855, -9
@smukkejohan
smukkejohan / linear_new_grid.json
Last active September 20, 2015 19:26
15 minute intervals nearest neighbour
{"frames": [[1442739803.0, [[-44.657949178787874, 60.044561680000001, 1.4059253857195528], [-43.076403357575757, 59.579467977142862, 1.4616652728849182], [-43.076403357575757, 59.73449921142857, 1.4722787930867547], [-43.076403357575757, 59.889530445714286, 1.4557777076382405], [-43.076403357575757, 60.044561680000001, 1.4411977403358549], [-43.076403357575757, 60.199592914285716, 1.4078186783853475], [-41.494857536363632, 59.114374274285716, 1.5722077248835056], [-41.494857536363632, 59.269405508571431, 1.4777032193989887], [-41.494857536363632, 59.424436742857146, 1.5319058908402732], [-41.494857536363632, 59.579467977142862, 1.5140278050185811], [-41.494857536363632, 59.73449921142857, 1.5058767935300186], [-41.494857536363632, 59.889530445714286, 1.4977257820414553], [-41.494857536363632, 60.044561680000001, 1.4667931839869002], [-41.494857536363632, 60.199592914285716, 1.433414122036393], [-39.913311715151515, 58.649280571428577, 1.6827501768820872], [-39.913311715151515, 58.804311805714292, 1.5244417433
{"locations": [["55fa0c3fa4b3e6c1db3352d8", [-2.0030175, 53.32466909999999], "High Peak Island", [[1442585820000.0, 1.2, "low"], [1442608380000.0, 4.2, "high"], [1442630700000.0, 1.5, "low"], [1442652780000.0, 4.0, "high"], [1442674800000.0, 1.4, "low"], [1442697780000.0, 4.0, "high"], [1442720400000.0, 1.8, "low"], [1442742360000.0, 3.7, "high"]]], ["55fa0b94a4b3e6c1db334758", [0.452189, 49.482777], "Tancarville", [[1442609160000.0, 2.7, "low"], [1442614800000.0, 7.5, "high"], [1442653020000.0, 2.8, "low"], [1442659260000.0, 7.4, "high"], [1442696940000.0, 2.9, "low"], [1442703480000.0, 7.2, "high"], [1442740860000.0, 3.0, "low"], [1442748240000.0, 7.1, "high"]]], ["55fa0c4aa4b3e6c1db3353a2", [-0.4666546, 52.1359729], "Bedford Island", [[1442584800000.0, 1.4, "low"], [1442606340000.0, 8.3, "high"], [1442628480000.0, 2.0, "low"], [1442650380000.0, 8.5, "high"], [1442672820000.0, 1.7, "low"], [1442694180000.0, 8.0, "high"], [1442716380000.0, 2.4, "low"], [1442738280000.0, 8.1, "high"]]], ["55fa0b95a4b3e6c1db33
@smukkejohan
smukkejohan / pir_osc_vardeLED.ino
Last active September 10, 2015 13:24
VardeLED Sensor to OSC
/*
- PIR Sensor (S+S REGELTECHNIK 1401-1110-4000-000) to OSC for Teensy LC
by Johan Bichel Lindegaard
*/
#include <Ethernet.h>
#include <EthernetUdp.h>
#include <SPI.h>
#include <OSCMessage.h>
clear.set("clear", false),
temperature.set("temperature", 0, 0, 20),
density.set("density", 0, 0, 1),
dissipation.set("dissipation", 0.99, 0, 1),
velocityDissipation.set("velocityDissipation", 0.99, 0, 1),
temperatureDissipation.set("temperatureDissipation", 0.99, 0, 1),pressureDissipation.set("pressureDissipation", 0.99, 0, 1),
emitPos.set("emit", ofVec2f(0.6,0.5), ofVec2f(0,0), ofVec2f(1,1)),
radius.set("radius", 0, 0, 30),
@smukkejohan
smukkejohan / MD5Worker.js
Created May 7, 2015 20:08
md5 hashing from stream with progress callback
m.prototype.getMD5 = function(filename, progressCallbackFunction){
var deffered = Q.defer();
var readBytes = 0;
var md5Hasher = crypto.createHash('md5');
var source = fs.createReadStream(filename);
source.on('data', function(chunk) {
md5Hasher.update(chunk);
@smukkejohan
smukkejohan / serialToLedMatrix.ino
Last active August 29, 2015 14:19
Control two adafruit i2c LED backpacks from serial
/**
* Serial to 2 adafruit LED matrices
*
*/
#include <Wire.h>
#include "Adafruit_LEDBackpack.h"
#include "Adafruit_GFX.h"
Adafruit_8x8matrix matrix = Adafruit_8x8matrix();
@smukkejohan
smukkejohan / serialmatrix.ino
Created April 23, 2015 17:30
Arduino serial matrix
/**
* openFrameworks Serial Test for Arduino
*
*/
#include <Wire.h>
#include "Adafruit_LEDBackpack.h"
#include "Adafruit_GFX.h"
@smukkejohan
smukkejohan / jrobot.nxc
Last active August 29, 2015 14:19
This program for the Lego NXT brick utilizes a light sensor, 2 touch sensors and 2 motors. It can drive around change direction when stuck by an obstacle. And if you put it in the spotlight, it stops and waits for darker times. The script is just a demonstration of some of the things that cen be done with Not Exactly C. jrobot.nxc
bool l;
bool r;
int plight;
bool lit;
int normlight;
int litcount = 0;
void Init()
{
//Reset sensors to ensure correct configuration. Perhaps this is overkill?
@smukkejohan
smukkejohan / maGlutfix.m
Created April 2, 2015 17:59
Trying to release mouse
#include <Cocoa/Cocoa.h>
#include <AppKit/NSOpenGL.h>
#include "macGlutfix.h"
// The standard ScreenSaverView class actually sets the window
// level to 2002, not the 1000 defined by NSScreenSaverWindowLevel
// and kCGScreenSaverWindowLevel
#define RealSaverLevel 1
// Glut sets the window level to 100 when it sets full screen mode