Skip to content

Instantly share code, notes, and snippets.

View smukkejohan's full-sized avatar

Johan Bichel Lindegaard smukkejohan

View GitHub Profile
@smukkejohan
smukkejohan / FilteringScheme.cpp
Last active August 29, 2015 13:56
Embassy Bowling
#include "FilteringScheme.h"
KalmanFilter::KalmanFilter() {}
KalmanFilter::KalmanFilter(float _q, float _r, float _p, float _intial_value) {
q = _q;
r = _r;
p = _p;
intial_value = _intial_value;
}
@smukkejohan
smukkejohan / README.md
Last active August 29, 2015 13:56 — forked from mbostock/.block

Example of flocking

@smukkejohan
smukkejohan / fishflocking.pde
Last active August 29, 2015 13:56 — forked from brysonian/index.html
Example of Flocking - Illutron - Nikola Lenivets
/**
* Flocking
* by Daniel Shiffman.
*
* An implementation of Craig Reynold's Boids program to simulate
* the flocking behavior of birds. Each boid steers itself based on
* rules of avoidance, alignment, and coherence.
*
* Click the mouse to add a new boid.
*/
function SaveGmailReceiptsToDriveAndForwardToXero(){
var label = GmailApp.getUserLabelByName("Receipts");
if(label == null){
GmailApp.createLabel('Receipts');
}
var savedLabel = GmailApp.getUserLabelByName("_savedAsPDF");
if(savedLabel == null){
GmailApp.createLabel("_savedAsPDF");
@smukkejohan
smukkejohan / gist:10017845
Created April 7, 2014 10:22
Map Example MEDTEK
import java.util.Date;
String server = "http://medtek.ruc.dk/2/fql.php?s=m&q=";
//String query = "SELECT author_uid,message,target_id,timestamp,coords FROM checkin WHERE author_uid IN (SELECT uid2 FROM friend WHERE uid1 = me() LIMIT 0, 10)";
String query = "SELECT timestamp,author_uid,message,target_id,coords FROM checkin WHERE author_uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) ORDER BY timestamp DESC LIMIT 0, 10";
String access = "INSERT ACCESS TOKEN";
String[] result = loadStrings(server+query.replace(' ', '+')+access);
int maks=min(10000, result.length);
PImage mapImage;
//String kortURL="http://maps.googleapis.com/maps/api/staticmap?size=800x900";
String kortURL="http://maps.googleapis.com/maps/api/staticmap?size=800x900&maptype=roadmap";
@smukkejohan
smukkejohan / app.js
Created October 6, 2014 10:17
Arduino to Web with Node.js, johnny-five and express
var five = require("johnny-five")
// or "./lib/johnny-five" when running from the source
var express = require('express');
var app = express();
var value = 0;
// Add headers
@smukkejohan
smukkejohan / crossFade.frag
Created November 5, 2014 15:01
Simple crossfade shader gl2 GLSL version 120
#version 120
uniform sampler2DRect tex0;
uniform sampler2DRect tex1;
uniform vec2 aTexSize;
uniform vec2 bTexSize;
uniform float fadeToB;
varying vec2 texCoordVarying;
@smukkejohan
smukkejohan / menger_sponge.lua
Created January 12, 2015 02:18
Minecraft Menger Sponge Builder Turtle
local position = vector.new(gps.locate(5))
cost_only = false
blocks = 0
fuel = 0
function up(b)
b = b or 1
for i = 1, b do
turtle.up()

Keybase proof

I hereby claim:

  • I am mrbichel on github.
  • I am yo (https://keybase.io/yo) on keybase.
  • I have a public key whose fingerprint is CC6E 8DDD C259 0C21 0DF7 2E29 B4BC 33A9 4A12 DFCC

To claim this, I am signing this object:

@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