Skip to content

Instantly share code, notes, and snippets.

View azdle's full-sized avatar

Patrick Barrett azdle

View GitHub Profile
@azdle
azdle / JSON Widget.js
Created August 22, 2013 13:32
JSON Editor Widget for Exosite Portals
// select one or more data sources from the list above to view this demo.
function( container, portal )
{
console.log("Script Started")
var settings_datasource = "sws"
var messageBox = document.createElement("div");
messageBox.style.display = "none";
messageBox.style.position = "absolute";
@azdle
azdle / Query.py
Created June 20, 2013 14:00
Windowed Exosite Query In Python
#!/usr/bin/python
import socket, ssl
header = """POST /api:v1/rpc/process HTTP/1.1
Host: m2.exosite.com
Content-Type: application/json; charset=utf-8
Content-Length: """
content = """{
@azdle
azdle / Exosite.agent
Created June 18, 2013 21:23
Exosite Demo Application for the Electric Imp
// Class for Communication to Exosite
class Exosite{
cik = null;
vendor = null;
model = null;
serial = null; // Consider hardware.getimpeeid() or imp.getmacaddress()
constructor(cikp = null, vendorp = null, modelp = null, serialp = null){
if(cikp == null){
server.log("No CIK, need to provision.")
@azdle
azdle / euler_003.rs
Created June 14, 2013 16:38
Project Euler Problem 3 in Rust using MutList
#!/usr/local/bin/rust run
/**
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
*/
extern mod extra;
@azdle
azdle / Agent Code
Last active December 18, 2015 07:59
Exosite Imp Agents Tests Reads respond with error code 52 (CURLE_GOT_NOTHING)
// Class for Communication to Exosite
class Exosite{
//Set CIK Manually Here or
cik = "654a29f2f230a2810a28036f79ab2fef17c058c4";
// Set Provisioning Parameters to Automatically Generate New CIK
vendor = null;
model = null;
serial = null; // Consider hardware.getimpeeid() or imp.getmacaddress()