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
public class ByteUtil { | |
/* ========================= */ | |
/* "primitive type --> byte[] data" Methods */ | |
/* ========================= */ | |
public static byte[] toByta(byte data) { | |
return new byte[]{data}; | |
} |
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
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
<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" /> |
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
public class UserManager extends Controller { | |
public static void index() { | |
if (getUser() == null) { | |
flash.error("Cannot use User Manager - Please log in"); | |
RingDNAController.index(); | |
} else | |
renderArgs.put(CURRENT_USER, getUser()); | |
List<User> users = getUsersFromOrg(); |
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
public class DevicesPortlet extends Application implements PortletListener{ | |
LiferayIPC liferayIPC = new LiferayIPC(); | |
@Override | |
public void init() { | |
Window mainWindow = new Window("Device Portlet"); | |
setMainWindow(mainWindow); | |
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 TeamsController < ApplicationController | |
def create | |
@team = Team.new(params[:team]) | |
respond_to do |format| | |
if @team.save | |
p "team-controller: #{@team.id}" #Loren: this is showing a value | |
format.html { redirect_to("/memberships/create", :team_id => @team.id) }#, :notice => 'Team was successfully created.') } | |
format.xml { render :xml => @team, :status => :created, :location => @team } | |
else |
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; |
NewerOlder