This file contains hidden or 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
| 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; |
This file contains hidden or 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
| <!-- 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"> |
This file contains hidden or 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
| <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"> |
This file contains hidden or 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
| <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"/> |
This file contains hidden or 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 type="text/javascript" src="js/PushNotification.js"></script> | |
| <script src="https://cdn.pubnub.com/sdk/javascript/pubnub.4.17.0.js"></scrip> |
This file contains hidden or 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
| 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 | |
This file contains hidden or 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
| $ npm install -g cordova |
This file contains hidden or 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
| 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({ |
This file contains hidden or 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
| 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(); |
This file contains hidden or 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="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> |