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 home = pubnub.sync('home'); |
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
<!-- Include the PubNub Library (use the beta version)--> | |
<script src="js/pubnub.js"></script> |
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
This is a gist for my blog/tutorial, "Creating a Chat App with Material Design using Polymer" |
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 five = require('johnny-five'); | |
var board = new five.Board(); | |
board.on('ready', function() { | |
led = new five.Led(5); // create a Led on pin 5 | |
led.strobe(1000); // strobe for 1000ms | |
this.repl.inject({ | |
led: led | |
}); | |
}); |
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
import sys | |
from pubnub import Pubnub | |
pubnub = Pubnub(publish_key='<your-pub-key>', subscribe_key='<your-sub-key>') | |
channel = 'hello-pi' | |
data = { | |
'username': 'Your name', | |
'message': 'Hello World from Pi!' |
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
import RPi.GPIO as GPIO | |
import sys | |
GPIO.setmode(GPIO.BCM) | |
PIN_LIVING = 4 | |
GPIO.setup(PIN_LIVING, GPIO.OUT) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
<script src="http://cdn.pubnub.com/pubnub-[version number].js"></script> |
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
function pub() { | |
console.log("publishing") | |
pubnub.publish({ | |
channel: "wnPutTime", | |
message: { | |
'uuid': uuid | |
}, | |
callback: function(m) { | |
console.log(m) | |
} |
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 lat, lon; | |
if ('geolocation' in navigator) { | |
navigator.geolocation.getCurrentPosition(function(position) { | |
lat = position.coords.latitude; | |
lon = position.coords.longitude; | |
console.log('lat: ' + lat); | |
console.log('lon: ' + lon); | |
console.log('geohash: ' + geohash(lat, 0) + '' + geohash(lon, 0)); |