Skip to content

Instantly share code, notes, and snippets.

View dpjanes's full-sized avatar

David Janes dpjanes

View GitHub Profile

Keybase proof

I hereby claim:

  • I am dpjanes on github.
  • I am dpjanes (https://keybase.io/dpjanes) on keybase.
  • I have a public key whose fingerprint is FB91 1EE6 3F32 CE3D 0C58 48A8 98F2 8D83 B36B F173

To claim this, I am signing this object:

@dpjanes
dpjanes / hue-light.jsonld
Last active May 2, 2019 01:36
JSON-LD Description of Hue Light
{
"@context": {
"@base": "file:///hue-light",
"@vocab": "file:///hue-light#",
"iot": "https://iotdb.org/pub/iot#",
"iot-attribute": "https://iotdb.org/pub/iot-attribute#",
"schema": "http://schema.org/"
},
"@id": "",
"@type": "iot:Model",
@dpjanes
dpjanes / gist:79a256c02c0a31c9aa42
Created June 3, 2015 13:04
WeMo Socket JSON-LD
{
"@context": {
"@base": "file:///we-mo-socket",
"@vocab": "file:///we-mo-socket#",
"iot": "https://iotdb.org/pub/iot#",
"schema": "http://schema.org/",
"iot-attribute": "https://iotdb.org/pub/iot-attribute#"
},
"@id": "",
"@type": "iot:Model",
{
"@context": {
"@base": "http://example.com/th",
"@vocab": "http://example.com/th",
"iot": "https://iotdb.org/pub/iot#",
"schema": "http://schema.org/",
"iot-attribute": "https://iotdb.org/pub/iot-attribute#"
},
"@type": "iot:Model",
"iot:attribute": [
@dpjanes
dpjanes / hue-light
Last active May 2, 2019 01:36
HueLight JSON-LD
{
"@context": {
"@base": "file:///hue-light",
"@vocab": "file:///hue-light#",
"iot": "https://iotdb.org/pub/iot#",
"schema": "http://schema.org/",
"iot-attribute": "https://iotdb.org/pub/iot-attribute#"
},
"@id": "",
"@type": "iot:Model",
@dpjanes
dpjanes / repeat-3.js
Created August 10, 2015 21:33
Cookbook / Recipe Example
/*
* repeat-3.js
*
* David Janes
* IOTDB.org
* 2014-12-30
*
* This will broadcast Count=0, Count=1, Count=3
* when pushed.
*/
@dpjanes
dpjanes / gist:2f4cebe6a6d7aaa14ede
Last active September 17, 2015 21:24
IOTQL Example - Turn on LED when Button Pressed
CREATE THING JohnnyFiveButton WITH pin = 4, meta:name = "The Button";
CREATE THING JohnnyFiveLED WITH pin = 6, meta:name = "The LED";
CREATE RULE
LED
WHERE
meta:name = "The Button"
BEGIN
SET
state:on = $_$state:on
@dpjanes
dpjanes / NetflixChill1.iotql
Created September 29, 2015 19:35
Netflix & Chill - IoTQL Example (1)
-- this assumes that the TV supports Netflix (my LG does)
CREATE SCENE
NetflixChill
BEGIN
SET
state:on = true,
state:band = iot-attribute:band.service.netflix
WHERE
meta:facet & iot-facet:media.tv;
AND
@dpjanes
dpjanes / NetflixChill2.iotql
Last active September 29, 2015 19:41
Netflix & Chill #2 - with IoTQL and Views
-- CREATE VIEW not implemented yet
CREATE VIEW
LivingRoom
WHERE
meta:zone & "Living Room";
CREATE ACTION
NetflixChill
BEGIN
UPDATE
@dpjanes
dpjanes / NetflixChill3.js
Created September 29, 2015 19:45
Netflix & Chill #3 - in JavaScript
things = require('iotdb').connect()
things
.with_facet(":media.tv")
.with_zone("Living Room")
.set(":on", true)
.set(":band", ":band.service.netflix")
things
.with_facet(":lighting")