Skip to content

Instantly share code, notes, and snippets.

View bobvanluijt's full-sized avatar

Bob van Luijt bobvanluijt

View GitHub Profile
@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!"