Skip to content

Instantly share code, notes, and snippets.

View stephenlb's full-sized avatar
😀
Coding with Rust

Stephen Blum stephenlb

😀
Coding with Rust
View GitHub Profile
@stephenlb
stephenlb / 02.html
Created November 15, 2017 21:05 — forked from domadev812/02.html
WebRTC Parts 1-3 Edits
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://cdn.pubnub.com/sdk/javascript/pubnub.4.17.0.js"></script>
<script src="https://cdn.pubnub.com/webrtc/webrtc.js"></script>
@stephenlb
stephenlb / config.2.xml
Created November 15, 2017 21:05 — forked from domadev812/config.2.xml
[Blog] Turning Your JavaScript Chat App Into Android and iOS App with PhoneGap
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.pubnub.com" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>SimpleChat</name>
...
<platform name="ios">
<icon src="app-icon-ios.png" />
...
</platform>
@stephenlb
stephenlb / 1
Created November 15, 2017 21:05 — forked from domadev812/1
Tutorial: Building a Raspberry Pi Smart Home (Part 1)
h,t = dht.read_retry(dht.DHT22, 4)
print 'Temp={0:0.1f}*C Humidity={1:0.1f}%'.format(t, h)
@stephenlb
stephenlb / 01.py
Created November 15, 2017 21:05 — forked from domadev812/01.py
Code samples for IoT 101 with Raspberry Pi Blog: http://www.pubnub.com/blog/internet-of-things-101-getting-started-w-raspberry-pi/
import sys
from pubnub.callbacks import SubscribeCallback
from pubnub.pnconfiguration import PNConfiguration
from pubnub.pubnub import PubNub
pnconfig = PNConfiguration()
pnconfig.subscribe_key = "my_subkey"
pnconfig.publish_key = "my_pubkey"
pnconfig.ssl = False
@stephenlb
stephenlb / 1.java
Created November 15, 2017 21:05 — forked from domadev812/1.java
Android Beacon Tutorial (Building the Detector - Listener - Observer)
private void setScanFilter() {
ScanFilter.Builder mBuilder = new ScanFilter.Builder();
ByteBuffer mManufacturerData = ByteBuffer.allocate(23);
ByteBuffer mManufacturerDataMask = ByteBuffer.allocate(24);
byte[] uuid = getIdAsByte(UUID.fromString("0CF052C297CA407C84F8B62AAC4E9020");
mManufacturerData.put(0, (byte)0xBE);
mManufacturerData.put(1, (byte)0xAC);
for (int i=2; i<=17; i++) {
mManufacturerData.put(i, uuid[i-2]);
}
@stephenlb
stephenlb / 1.js
Created November 15, 2017 21:05 — forked from domadev812/1.js
Vehicle Tracking on Realtime Maps
var drivers = [
{ latlng: [30.370375, -97.756138] },
{ latlng: [30.323118, -97.739144] },
{ latlng: [30.302816, -97.699490] },
{ latlng: [30.293479, -97.742405] },
{ latlng: [30.250337, -97.754593] },
{ latlng: [30.236689, -97.762730] }
];
@stephenlb
stephenlb / 1.html
Created November 15, 2017 21:05 — forked from domadev812/1.html
Stream Data to Create Realtime Charts w/ D3.js and Rickshaw
<script type="text/javascript" src="//pubnub.github.io/eon/v/eon/1.0.0/eon.js"></script>
<link type="text/css" rel="stylesheet" href="//pubnub.github.io/eon/v/eon/1.0.0/eon.css"/>
<script src="https://cdn.pubnub.com/sdk/javascript/pubnub.4.17.0.js"></script>
<script src="../vendor/d3.v3.js"></script>
<script src="../rickshaw.min.js"></script>
<script src="../src/js/Rickshaw.Fixtures.PubNub.js"></script>
@stephenlb
stephenlb / 1.bash
Created November 15, 2017 21:05 — forked from domadev812/1.bash
Tutorial: Share Your Current Location From Your iOS Device in Real-Time With PubNub
$ pod init
$ {your favorite editor} Podfile
@stephenlb
stephenlb / gauge.js
Created November 15, 2017 21:05 — forked from domadev812/gauge.js
eon.chart({
channel: 'humeon',
generate: {
bindto: '#chart',
data: {
type: 'gauge',
},
gauge: {
min: 0,
max: 100
@stephenlb
stephenlb / 1.py
Created November 15, 2017 21:05 — forked from domadev812/1.py
Pi-o-T: Prototyping IoT w/ Data Streams and Raspberry Pi (E. Grossman)
from pubnub.pnconfiguration import PNConfiguration
from pubnub.pubnub import PubNub
import RPi.GPIO as GPIO
import time
import sys
loopcount = 0