Skip to content

Instantly share code, notes, and snippets.

Avatar
😀
Coding with Rust

Stephen Blum stephenlb

😀
Coding with Rust
View GitHub Profile
@stephenlb
stephenlb / index.js
Created May 1, 2018 — forked from ajb413/index.js
audio lext test
View index.js
var AWS = require('aws-sdk');
AWS.config.update({
accessKeyId: "__id__",
secretAccessKey: "__secret__",
});
var lexruntime = new AWS.LexRuntime({region: 'us-east-1'});
View pubnubheartrateios-captureframe
- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection {
// if we're paused don't do anything
if(self.currentState==STATE_PAUSED) {
// reset our frame counter
self.validFrameCounter=0;
return;
}
@stephenlb
stephenlb / 1.js
Created Nov 15, 2017 — forked from domadev812/1.js
Streaming Sensor Readings to a Realtime Gauge Chart
View 1.js
var five = require("johnny-five");
var board = new five.Board();
var pubnub = new PubNub({
subscribeKey: "mySubscribeKey",
publishKey: "myPublishKey",
ssl: true
})
@stephenlb
stephenlb / publishMsg.c
Created Nov 15, 2017 — forked from domadev812/publishMsg.c
Code chunks from project javamon
View publishMsg.c
// Publish the value using PubNub
static void publishMsg (void)
{
// Check values for I2C line error...
if (TWI_msg[0] > 99 || TWI_msg[1] > 99) {
TWI_fullMsg = 10000;
}
// Ignore very small values
else if (TWI_msg[0] == 0 && TWI_msg[1] < 50) {
TWI_fullMsg = 0;
@stephenlb
stephenlb / 1.h
Created Nov 15, 2017 — forked from domadev812/1.h
Arduino To PubNub In Two Steps
View 1.h
#include <SPI.h>
#include <Ethernet.h>
#include <Pubnub.h>
#include "string.h"
#include "iotconnector.h"
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
char pubkey[] = "PUBLISH KEYS HERE";char subkey[] = "SUBSCRIBE KEYS HERE";char channel[] = "iotchannel";char uuid[] = "Arduino";
@stephenlb
stephenlb / 1.js
Created Nov 15, 2017 — forked from domadev812/1.js
Creating Real-Time WebGL Visualizations
View 1.js
function handleMsg(msg) {
if (VISIBLE) {
addData(msg.pub, msg.subs);
}
}
pubnub = new PubNub({
publishKey : 'demo',
subscribeKey : 'demo'
})
@stephenlb
stephenlb / 1.html
Created Nov 15, 2017 — forked from domadev812/1.html
Displaying Live Location Points & Tracks with JavaScript & MapBox and PubNub
View 1.html
<script src="https://cdn.pubnub.com/sdk/javascript/pubnub.4.17.0.js"></script>
<script src='https://api.tiles.mapbox.com/mapbox.js/v2.1.4/mapbox.js'></script>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<link href='https://api.tiles.mapbox.com/mapbox.js/v2.1.4/mapbox.css' rel='stylesheet' />
@stephenlb
stephenlb / 01.py
Created Nov 15, 2017 — forked from domadev812/01.py
[Blog] DIY Hue Lightbulb with Android Control
View 01.py
#!/usr/bin/python
import time
import RPi.GPIO as GPIO
from pubnub.pnconfiguration import PNConfiguration
from pubnub.pubnub import PubNub
@stephenlb
stephenlb / 1.html
Created Nov 15, 2017 — forked from domadev812/1.html
Transportation Delay: Create Real-Time Visualization of Data Using NVD3 And PubNub
View 1.html
<script src='https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.3/d3.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.min.js'></script>
<link href='https://cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.min.css' rel='stylesheet'>
@stephenlb
stephenlb / 1.swift
Created Nov 15, 2017 — forked from domadev812/1.swift
Smart iBeacons in the Swift Programming Language
View 1.swift
class Brain: NSObject, PNDelegate {
let configuration = PNConfiguration(publishKey: "demo", subscribeKey: "demo")
var channel = PNChannel()
var serverStatus = UILabel()
init() {
super.init()
}
}
You can’t perform that action at this time.