This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "class": [ "order" ], | |
| "properties": { | |
| "orderNumber": 42, | |
| "itemCount": 3, | |
| "status": "pending" | |
| }, | |
| "entities": [ | |
| { | |
| "class": [ "items", "collection" ], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct Order { | |
| 1: optional set<string> class_ | |
| 2: optional OrderProperties properties | |
| 3: optional OrderSubEntities entities | |
| 4: optional set<Action> actions | |
| 5: optional set<Link> links | |
| } | |
| struct OrderProperties { | |
| 1: required i32 orderNumber |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var util = require('util'); | |
| var Device = require('zetta').Device; | |
| var LED = module.exports = function() { | |
| Device.call(this); | |
| this.intensity = 0; | |
| var self = this; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var adapt = require('argo-connect'); | |
| var express = require("express"); | |
| var RED = require("node-red"); | |
| module.exports = function(server) { | |
| var cloud = server.httpServer.cloud; | |
| var httpServer = server.httpServer.server; | |
| // Create an Express app | |
| var app = express(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Device from 'zetta-device'; | |
| export default class Heartbeat extends Device { | |
| constructor() { | |
| super(); | |
| this.pulse = null; | |
| } | |
| init(config) { | |
| config |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var util = require('util'); | |
| var Device = require('zetta').Device; | |
| /// # heartbeat | |
| /// | |
| /// A mock heartbeat sensor, often used as a driver example | |
| /// for exposing streams. | |
| /// | |
| /// This device has the following properties: | |
| /// * `pulse` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var marked = require('marked'); | |
| var siren = require('siren'); | |
| marked.setOptions({ | |
| gfm: true | |
| }); | |
| var root = 'http://localhost:1337/'; | |
| siren() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl http://zetta-cloud-2.herokuapp.com | \ | |
| json links | \ | |
| json -ac 'this.rel.indexOf("http://rels.zettajs.io/server") > -1 && this.title == "Detroit"' | \ | |
| json href | \ | |
| xargs curl | \ | |
| json entities | \ | |
| json -ac 'this.rel.indexOf("http://rels.zettajs.io/device") > -1 && this.class.indexOf("light") > -1' | \ | |
| json links | \ | |
| json -ac 'this.rel.indexOf("self") > -1' | \ | |
| json href | \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "alps": { | |
| "version": "1.0", | |
| "descriptor": [ | |
| { | |
| "id": "led-type", | |
| "name": "led", | |
| "type": "semantic", | |
| "descriptor": [ | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var argo = require('argo'); | |
| var router = require('argo-url-router'); | |
| argo() | |
| .use(router) | |
| .route('/molds/{splat: .*}', function (handle) { | |
| handle('request', function (env, next) { | |
| var targets = { | |
| 'google': 'http://google.com', | |
| 'yahoo': 'http://yahoo.com' |