Skip to content

Instantly share code, notes, and snippets.

View bobvanluijt's full-sized avatar

Bob van Luijt bobvanluijt

View GitHub Profile
10 PRINT "Hello World!"
@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
*/
@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 / 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 / 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 / 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 / Weave - aclEntries.json
Created February 6, 2017 20:55
Weave - aclEntries
{
"AclEntry": {
"properties": {
"cloudAccessRevoked": {
"description": "Indicates whether the AclEntry has been revoked from the cloud and the user has no cloud access, but they still might have local auth tokens that are valid and can access the device and execute commands locally. See localAccessInfo for local auth details.",
"type": "boolean"
},
"creatorEmail": {
"description": "User who created this entry. At the moment it is populated only when pending == true.",
"type": "string"
@bobvanluijt
bobvanluijt / Weave - authorizedApps.json
Created February 6, 2017 21:00
Weave - authorizedApps
{
"AuthorizedApp": {
"properties": {
"androidApps": {
"description": "Android apps authorized under this project ID.",
"items": {
"properties": {
"certificate_hash": {
"description": "Android certificate hash.",
"type": "string"
@bobvanluijt
bobvanluijt / Weave - commands.json
Created February 6, 2017 21:03
Weave - commands
{
"Command": {
"externalTypeName": "clouddevices.Command",
"properties": {
"blobParameters": {
"$ref": "#/definitions/JsonObject",
"description": "Blob parameters list."
},
"blobResults": {
"$ref": "#/definitions/JsonObject",