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
<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 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
h,t = dht.read_retry(dht.DHT22, 4) | |
print 'Temp={0:0.1f}*C Humidity={1:0.1f}%'.format(t, h) |
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 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 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.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 | |
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
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]); | |
} |
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
<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 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
$(document).ready(function () { | |
// Initialize the PubNub API connection. | |
pubnub = new PubNub({ | |
publishKey : 'PUBNUB PUBLISH KEY HERE', | |
subscribeKey : 'PUBNUB SUBSCRIBE KEY HERE' | |
}) | |
// Grab references for all of our elements. | |
var messageContent = $('#messageContent'), | |
sendMessageButton = $('#sendMessageButton'), |
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 type="text/javascript" src="js/PushNotification.js"></script> | |
<script src="https://cdn.pubnub.com/sdk/javascript/pubnub.4.17.0.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
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] } | |
]; |
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
$('#toggle').click(function(e){ | |
pubmsg = { "req" : "toggle" }; | |
var publishConfig = { | |
channel : 'gpio-raspberry-control', | |
message : pubmsg | |
} | |
pubnub.publish(publishConfig, function(status, response) { | |
console.log(status, response); |
OlderNewer