Skip to content

Instantly share code, notes, and snippets.

View tomtor's full-sized avatar

Tom Vijlbrief tomtor

View GitHub Profile
@tomtor
tomtor / CCS811_test.ino
Last active June 2, 2017 13:46
CCS811 low power Arduino sketch
/***************************************************
This is an example for the CCS811 digital TVOC/eCO2 Sensor by CCMOSS/AMS
http://www.ccmoss.com/gas-sensors#CCS811
Updated: March 28, 2017
The sensor uses I2C protocol to communicate, and requires 2 pins - SDA and SCL
Another GPIO is also required to assert the WAKE pin for communication. this
pin is passed by an argument in the begin function.
----------------------------------------------------------------------------
-- CRS conversion functions for GeoJSON coordinates and lat/long pairs
-- in PostgreSQL/PostGIS:
--
-- from (Google) Web Mercator (OpenLayers:900913, EPSG:3785 and EPSG:3857 (prefered))
-- and WGS-84 Lat (y) Long (x) (EPSG:4326)
--
-- to EPSG:28992 (RD new)
--
-- Needs the PostGIS extension (surprise ;-)
-- See
-- http://stackoverflow.com/questions/18209625/how-do-i-modify-fields-inside-the-new-postgresql-json-datatype
-- All credits to the original author
---------------------------------------------------------------------------------------------------------------
CREATE OR REPLACE FUNCTION "json_object_set_key"(
"json" json,
"key_to_set" TEXT,
"value_to_set" anyelement
)
@tomtor
tomtor / MendixWidgetWrapper.html
Created May 26, 2016 15:57
A simple Wrapper for Mendix Widgets
<html>
<head>
<script src="../lib/jquery-1-11-3.js"></script>
</head>
<body>
<script>
function declare_f(w, a, p) {
p.domNode= $('body')[0];
p._contextObj= { set: function(k,v) { console.log(v); }};
@tomtor
tomtor / rdtape.c
Created March 19, 2016 22:40
Convert SIMH simulator tapes to normal files
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
/*
* Convert SIMH simulator tapes to normal files
*
* Copyright 2016 Tom Vijlbrief
*
* tvijlbrief at gmail dot com