Skip to content

Instantly share code, notes, and snippets.

View stephenlb's full-sized avatar
😁
Coding Python, Rust, JavaScript, AI

Stephen Blum stephenlb

😁
Coding Python, Rust, JavaScript, AI
View GitHub Profile
@stephenlb
stephenlb / 1.js
Created November 15, 2017 21:05 — forked from domadev812/1.js
<script src="https://cdn.pubnub.com/sdk/javascript/pubnub.4.17.0.js"></script>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script src="../js/c3.js"></script>
<script src="../js/pubnub-c3.js"></script>
@stephenlb
stephenlb / pubnubheartrate-algo
Created November 15, 2017 21:05 — forked from domadev812/pubnubheartrate-algo
Heartrate monitoring using PubNub
private static PreviewCallback previewCallback = new PreviewCallback() {
/**
* {@inheritDoc}
*/
@Override
public void onPreviewFrame(byte[] data, Camera cam) {
if (data == null) throw new NullPointerException();
Camera.Size size = cam.getParameters().getPreviewSize();
if (size == null) throw new NullPointerException();
@stephenlb
stephenlb / 1.html
Created November 15, 2017 21:05 — forked from domadev812/1.html
Enter Chat and press enter
<div><input id=input placeholder=you-chat-here /></div>
Chat Output
<div id=box></div>
<script src="https://cdn.pubnub.com/sdk/javascript/pubnub.4.17.0.js"></script>
<script>(function(){
var pubnub = new PubNub({
@stephenlb
stephenlb / 1.bash
Created November 15, 2017 21:05 — forked from domadev812/1.bash
Build an Android mobile Chat App with PhoneGap & Cordova
$ npm install -g cordova
@stephenlb
stephenlb / RasCam Constants.py
Created November 15, 2017 21:05 — forked from domadev812/RasCam Constants.py
Raspberry Pi Security Cam (Kevin and Justin)
from pubnub.pnconfiguration import PNConfiguration
from pubnub.pubnub import PubNub
from detector import Detector
import RPi.GPIO as GPIO
import time
import picamera
import sys, os
import json,httplib
import base64
@stephenlb
stephenlb / cordova-01.html
Created November 15, 2017 21:05 — forked from domadev812/cordova-01.html
Snippets for blog, "Sending iOS Push Notifications via APNS in JavaScript using PhoneGap and PubNub"
<script type="text/javascript" src="js/PushNotification.js"></script>
<script src="https://cdn.pubnub.com/sdk/javascript/pubnub.4.17.0.js"></scrip>
@stephenlb
stephenlb / 1.xml
Created November 15, 2017 21:05 — forked from domadev812/1.xml
android push notification intro tutorial
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission android:name="your.package.name.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="your.package.name.permission.C2D_MESSAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
@stephenlb
stephenlb / index.html
Created November 15, 2017 21:06 — forked from domadev812/index.html
Header section for PubNub Messenger.
<head>
<title>PubNub Messenger</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon href=icon.png">
<link rel="apple-touch-startup-image href=startup.png">
@stephenlb
stephenlb / index.html
Created November 15, 2017 21:06 — forked from domadev812/index.html
Initial chat page for PubNub Messenger Tutorial.
<!-- Chat Page -->
<div data-role="page" id="chatPage" data-theme="c" class="type-interior">
<div data-role="content">
<div data-role="header" data-position="fixed" data-tap-toggle="false">
<h1>Pub Messenger</h1>
</div><!-- /header -->
<div data-role="content">
<ul data-role="listview" id="messageList">
@stephenlb
stephenlb / Main.java
Created November 15, 2017 21:06 — forked from domadev812/Main.java
Leap Motion - R Pi Remote Control Hands Edits
public class LeapToServo implements Runnable{
//Define Channel name
public static final String CHANNEL = "my_channel";
//Create PubNub instance
private Pubnub pubnub;
//Create Leap Controller instance
private Controller controller;
//is Runnable running?
private boolean running;