Skip to content

Instantly share code, notes, and snippets.


Kenneth Falck kennu

View GitHub Profile
#!/usr/bin/env python
from __future__ import print_function
import json
import re
def acars2json(filename):
messages = []
message = { 'header':'', 'content': ''}
with open(filename) as f:
line = f.readline()
kennu / vrrender.js
Last active Aug 29, 2015
Oculus Web GL Examples
View vrrender.js
function render(time) {
// Render next frame
// Update camera with VR head tracking data
// Render screen in VR mode or in regular 3D mode
if (inFullscreen && displayDevice) {
kennu / vrapi.js
Last active Aug 29, 2015
Oculus WebGL Examples
View vrapi.js
if (navigator.getVRDevices) {
var displayDevice, sensorDevice;
navigator.getVRDevices().then(function (devices) {
for (var i = 0; i < devices.length; i++) {
if (!displayDevice && devices[i] instanceof HMDVRDevice) {
displayDevice = devices[i];
for (var i = 0; i < devices.length; i++) {
if (!sensorDevice && devices[i] instanceof PositionSensorVRDevice && (!displayDevice || devices[i].hardwareUnitId == displayDevice.hardwareUnitId)) {

Keybase proof

I hereby claim:

  • I am kennu on github.
  • I am kennu ( on keybase.
  • I have a public key whose fingerprint is 9275 6FAB 0E7E E729 AD5A DE97 C162 C8F2 10C4 652A

To claim this, I am signing this object:

kennu / helloworld.c
Last active Aug 29, 2015
Pebble JavaScript example
View helloworld.c
/* Native C code for sending an AppMessage when the Select button is pressed. */
/* The response is shown on the watch screen. */
#include <pebble.h>
static Window *window;
static TextLayer *text_layer, *text_layer2;
static const uint32_t LOCATION_KEY = 123;
static const uint32_t WEATHER_KEY = 124;
kennu /
Last active Sep 25, 2020
Testing Express apps with random ports
# CoffeeScript version
http = require 'http'
express = require 'express'
app = express()
server = http.createServer(app).listen()
app.set 'port', server.address().port
app.get '/', (req, res) -> res.send hello:'world'
baseurl = '' + app.get('port') + '/'
kennu /
Created Sep 22, 2011
Script for generating a Selenium Test Case to delete old Facebook updates
#!/usr/bin/env python
# This script generates a Selenium Test Case (.html) which will delete all your old Facebook status updates when run in the browser.
# The MAX_AGE setting specifies the number of days of old status updates to keep.
# Created by Kenneth Falck <> 2011
MAX_AGE = 30
from urllib import urlretrieve
from datetime import datetime, timedelta
import imp