This file contains 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
JS, version ES6 | |
HTTPS server: | |
+ node.js | |
+ express.js (server framework) | |
+ nodepostgres | |
+ JWT (token management) | |
+ react (universal rendering) | |
+ websockets (later in the project) | |
+ superagent (serverside HTTP client towards 3rd party services) |
This file contains 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 displayMessages = function(ms) { ms[0].forEach(displayMessage); }; | |
pubnub.history({ | |
channel: 'pubnub-git', | |
callback: displayMessages, | |
count: 100 | |
}); |
This file contains 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
// (In ViewController.m add to viewDidLoad:) | |
[PubNub setConfiguration:[PNConfiguration defaultConfiguration]]; | |
[PubNub connect]; | |
PNChannel *channel_1 = [PNChannel channelWithName:@"a" shouldObservePresence:YES]; | |
[PubNub subscribeOnChannel:channel_1]; | |
[PubNub sendMessage:@"Hello from PubNub iOS!" toChannel:channel_1]; |
This file contains 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 pubnub = require("pubnub").init({publish_key: "demo", subscribe_key: "demo" }); | |
var tessel = require("tessel") | |
, ambient = require('ambient-attx4').use(tessel.port['A']); | |
var conn = function() { | |
console.log("Running connect function"); | |
ambient.on('ready', function () { | |
ambient.setSoundTrigger(0.1); |
This file contains 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 pubnub = require("pubnub").init({ publish_key: "demo", subscribe_key: "demo" }); | |
var tessel = require("tessel"); | |
pubnub.subscribe({ channel: "tessel-light", message: function(m) { | |
tessel.led[1].toggle(); | |
}}); |
This file contains 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 pubnub = require("pubnub").init({ | |
publish_key: "demo", | |
subscribe_key: "demo", | |
uuid: "your_name_here" + Math.floor(Math.random()*1000) | |
}); | |
var tessel = require("tessel"); | |
var led1 = tessel.led[0].output(); | |
var led2 = tessel.led[1].output(); | |
var led3 = tessel.led[2].output(); |
This file contains 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 pubnub = require("pubnub").init({publish_key: "demo", subscribe_key: "demo" }); | |
var tessel = require("tessel") | |
, ambient = require('ambient-attx4').use(tessel.port['A']) | |
, rfid = require('rfid-pn532').use(tessel.port['D']) | |
; | |
var conn = function() { | |
console.log("Running connect function"); | |
rfid.on('ready', function (version) { |
This file contains 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
To Launch the PubNub interactive Xiki command: | |
$ pubnub | |
To launch the PubNub interactive Xiki command and start publishing messages to a channel: | |
$ pubnub %channelname |