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 zrx = require('zrx'); | |
| zrx() | |
| .load('http://zetta-cloud-2.herokuapp.com') | |
| .server('Detroit') | |
| .device(function(d) { | |
| return d.type === 'light'; | |
| }) | |
| .stream('luminosity') | |
| .sample(5000) |
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 Rx = require('rx'); | |
| var siren = require('siren'); | |
| var display = new Rx.Subject(); | |
| siren() | |
| .load('http://zetta-cloud-2.herokuapp.com') | |
| .link('http://rels.zettajs.io/peer', 'Detroit') | |
| .entity(function(e) { | |
| return e.properties.type === 'display'; |
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 select = require('refine').select; | |
| var revolt = require('revolt'); | |
| revolt() | |
| .get('http://zetta-cloud-2.herokuapp.com') | |
| .flatMap(deserialize) | |
| .flatMap(function(entity) { | |
| var detroitLink = select(entity.links) | |
| .where('rel').contains('http://rels.zettajs.io/peer') | |
| .and('title').equals('Detroit')[0]; |
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
| module.exports = function(server) { | |
| var original = server.httpServer.setupEventSocket; | |
| server.httpServer.setupEventSocket = function(ws) { | |
| console.log('Subscribing to URL:', ws.upgradeReq.url); | |
| original.call(server.httpServer, ws); | |
| }; | |
| }; |
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
| <entity class="order"> | |
| <properties> | |
| <property name="orderNumber">42</property> | |
| <property name="itemCount">3</property> | |
| <property name="status">pending</property> | |
| </properties> | |
| <entities> | |
| <entity class="items collection" | |
| rel="http://x.io/rels/order-items" | |
| href="http://api.x.io/orders/42/items" /> |
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
| { | |
| "living-room": { | |
| "switches": [ | |
| { | |
| "id": "bf727e79-401c-4bf1-af6d-f79278d8f67b", | |
| "state": "off" | |
| }, | |
| { | |
| "id": "c1abd37a-a1b5-402f-b5c1-78d764c4e6c1", | |
| "state": "off" |
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
| number [+-]?[0-9]*\.?[0-9]+(?:[eE][-+]?[0-9]+)? | |
| name [A-Za-z0-9_-][\.A-Za-z0-9_-]* | |
| escaped_name \[(?:(?!\])[^\\]|\\.)*\] | |
| %options case-insensitive | |
| %x sel fltr asgn loc ordby | |
| %% |
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": ["customer", "vip"], | |
| "properties": { | |
| "name": "Howard Duck", | |
| "title": "Mr." | |
| }, | |
| "entities": [ | |
| { | |
| "rel": ["http://example.com/rels/recent-orders"], | |
| "class": ["order-list"], |
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
| { | |
| servers: [ | |
| { | |
| name: 'detroit', | |
| type: 'peer', | |
| devices: [ | |
| { | |
| type: 'microphone', | |
| streams: [ | |
| { |
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
| #include "duktape.h" | |
| int main() { | |
| duk_context *ctx = duk_create_heap_default(); | |
| duk_eval_string(ctx, "print('Hello World'.replace(/\\s+|l*/g, ''));"); | |
| duk_destroy_heap(ctx); | |
| return 0; |