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 sdk = require('aws-iot-device-sdk'); | |
var shadow = sdk.thingShadow({ | |
keyPath: 'certs/private.pem.key', | |
certPath: 'certs/certificate.pem.crt', | |
caPath: 'certs/root-CA.crt', | |
clientId: 'rmb-cid', | |
region: 'us-east-1' | |
}); |
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
package com.twolemetry.app.sampleapiinterface; | |
import java.io.IOException; | |
import org.json.simple.JSONArray; | |
import org.json.simple.JSONObject; | |
import com.mashape.unirest.http.HttpResponse; | |
import com.mashape.unirest.http.JsonNode; | |
import com.mashape.unirest.http.Unirest; |
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
<div> | |
<button ng-click='publishMsg()'>Publish!</button> | |
</div> | |
<div class="stream"> | |
<p ng-show="stream.length===0">Awaiting messages...</p> | |
<table ng-show="stream.length!==0" class="table table-striped table-nonfluid"> | |
<thead> | |
<tr> | |
<th>Timestamp</th> | |
<th>Message</th> |
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 request = require('request'); | |
// http://2lemetry.com/2014/11/18/smarter-client-usage-pooling/ | |
var getClientFromPool = function(poolSize, prefix) { | |
var pick = Math.floor((Math.random() * poolSize) + 1); | |
prefix = prefix || "client"; | |
var clientId = prefix.concat(pick); | |
return clientId; // e.g. "client74" |
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 aws = require('aws-sdk'); | |
var http = require('http'); | |
var s3 = new aws.S3({apiVersion: '2006-03-01'}); | |
exports.handler = function(event, context) { | |
var bucket = event.Records[0].s3.bucket.name; | |
var key = event.Records[0].s3.object.key; | |
s3.getObject({Bucket:bucket, Key:key}, | |
function(err,data) { | |
if (err) { |
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
[ | |
{ | |
"location":"40.1234,-103.9876", | |
"temperature":50 | |
}, | |
{ | |
"location":"41.1234,-104.9876", | |
"temperature":100 | |
}, | |
{ |
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 org.eclipse.paho.client.mqttv3.MqttCallback; | |
import org.eclipse.paho.client.mqttv3.MqttClient; | |
import org.eclipse.paho.client.mqttv3.MqttConnectOptions; | |
import org.eclipse.paho.client.mqttv3.MqttDeliveryToken; | |
import org.eclipse.paho.client.mqttv3.MqttException; | |
import org.eclipse.paho.client.mqttv3.MqttMessage; | |
import org.eclipse.paho.client.mqttv3.MqttTopic; | |
public class SimpleMqttClient implements MqttCallback { |
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
<html> | |
<head> | |
<script src="/socket.io/socket.io.js"></script> | |
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> | |
</head> | |
<body> | |
<h1>1</h1> |
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
class Address(street: String, street2: String, city: String, state: String, zip: String) {} | |
class User(email: String, shippingAddress: Address, billingAddress: Address) {} | |
def storeUser(user: User) = { | |
val userjson = jerkson.generate(user) | |
// put this userjson in cassandra | |
WS.url(URL + "/" + java.util.UUID.randomUUID()).post(userjson) | |
} |
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
offline_tracking.html | |
--------------------- | |
<script src="@{'/public/js/libs/fileupload/jquery.ui.widget.js'}"></script> | |
<script src="@{'/public/js/libs/fileupload/jquery.iframe-transport.js'}"></script> | |
<script src="@{'/public/js/libs/fileupload/jquery.fileupload.js'}"></script> | |
#{form @APICallScriptController.newCallScript(viewModel.rDnaId), id:'newScriptForm', enctype:'multipart/form-data'} | |
Script name: <input type="text" id="scriptName" name="name" /> | |
<br /> | |
<input type="file" id="fileupload" name="scriptFile" /> |
NewerOlder