Skip to content

Instantly share code, notes, and snippets.

View bobvanluijt's full-sized avatar

Bob van Luijt bobvanluijt

View GitHub Profile
@bobvanluijt
bobvanluijt / Weave - Adapters.json
Created February 6, 2017 20:30
Weave - Adapters
{
"Adapter": {
"properties": {
"activateUrl": {
"description": "URL to adapter web flow to activate the adapter. Deprecated, use the activationUrl returned in the response of the Adapters.activate API.",
"type": "string"
},
"activated": {
"description": "Whether this adapter has been activated for the current user.",
"type": "boolean"
@bobvanluijt
bobvanluijt / fullscreen-video.js
Created April 6, 2016 14:57
Center a video element in full screen mode
/**
* Set the video sizes
*/
var videoWith = 1280,
videoHeight = 720;
/**
* The magic
*/
var videoRatio = videoHeight / videoWith,
@bobvanluijt
bobvanluijt / howToDrawALine.js
Last active March 20, 2016 10:24
What to do with x to draw a horizontal line?
const EtherDream = require('./etherdream.js').EtherDream,
numpoints = 35000;
console.log('Looking for EtherDream hosts...')
EtherDream.findFirst(function(all) {
if (all.length == 0) {
console.log('Didn\'t find any EtherDream on the network.');
return;
}
@bobvanluijt
bobvanluijt / falcor_vs_google_schema
Last active February 19, 2016 09:57
Different JSON schema implementations, Falcor vs Google API
/**
* Falcor
*/
{ $type: "ref", value: ["todosById", 44] }
/* or */
var $ref = falcor.Model.ref;
$ref('todosById[44]')
/**
* Google API
@bobvanluijt
bobvanluijt / Weave-example-call.json
Created February 3, 2016 09:24
This is an example call for the OnBobCommand
{
"deviceId": "abcd1234-abcd-1234-abcd-abcdef123456",
"name": "_someSample.bobCommand",
"component": "someSample"
}
@bobvanluijt
bobvanluijt / Exampl-chunk-Libweave.cpp
Last active February 3, 2016 13:45
Example chunk C++ for sending an action via Weave
[...]
/**
* Google Weave example by @bobvanluijt
* This example shows the private function 'OnBobCommand' which is proccesed when the deamon receives a request
*/
private:
void OnBobsCommand(const std::weak_ptr<weave::Command>& command) {
/**
* Chunk: processing the received command
*/
10 PRINT "Hello World!"