Skip to content

Instantly share code, notes, and snippets.

View krhoyt's full-sized avatar

Kevin Hoyt krhoyt

View GitHub Profile
@krhoyt
krhoyt / aws-cli-policy
Created June 5, 2014 17:36
Series of command line steps used to create Kaazing Gateway instances on Amazon Web Services (AWS).
[default]
output = json
region = us-east-1
aws_access_key_id = __YOUR_KEY_ID__
aws_secret_access_key = __YOUR_SECRET_KEY__
@krhoyt
krhoyt / kaazing.me.py
Last active August 29, 2015 14:02
Create a Kaazing Gateway instance on Amazon Web Services EC2
# AWS Python library
import boto
# Hidden password input
import getpass
# Unique file name
import tempfile
# OS-level chmod access
@krhoyt
krhoyt / yun-stomp.ino
Created October 20, 2014 20:18
Custom rolled STOMP client for Arduino Yun. Should work with Ethernet client as well. Shows both publishing and subscribing.
// Libraries
#include <Bridge.h>
#include <Console.h>
#include <YunClient.h>
// Connectivity parameters
#define ENDPOINT "kaazing.kevinhoyt.com"
#define LOGIN " "
#define PASSCODE " "
#define PORT 61613
@krhoyt
krhoyt / tessel-climate-parse.js
Created November 20, 2014 15:50
First Steps with Tessel
// Libraries
var climate = require( 'climate-si7020' );
var parse = require( 'parse' ).Parse;
var tessel = require( 'tessel' );
var wifi = require( 'wifi-cc3000' );
// Constants
var PARSE_APP = '_YOUR_APP_KEY_';
var PARSE_KEY = '_YOUR_JAVASCRIPT_KEY_';
@krhoyt
krhoyt / proxy.html
Created November 20, 2014 16:20
Personal data proxy.
<html>
<head>
<title>Proxy Test</title>
<script>
// Echo
var echo = {
action: "ECHO",
whatever: {
@krhoyt
krhoyt / pubnub.ino
Created December 2, 2014 21:31
Spark Core to PubNub
// Libraries
#include <math.h>
// Literals
#define THERMISTOR A0
// Constants
// Thermistor computation
const float ANALOG_STEPS = 4095.0;
const float B_THERM = 3977.0;
@krhoyt
krhoyt / spinning-color-wheel.html
Created December 5, 2014 17:00
Spinning color wheel ... Mostly just because the idea popped into my head.
<html>
<head>
<title>Spinning Color</title>
<!-- Styles -->
<style type="text/css">
@-webkit-keyframes spin {
from {
transform: rotate( 0deg );
@krhoyt
krhoyt / amqp-boilerplate.html
Created December 5, 2014 19:19
Boilerplate for Kaazing Gateway AMQP JavaScript client.
<html>
<head>
<title>AMQP Boilerplate</title>
<script src="http://localhost:8001/demo/amqp/javascript/WebSocket.js" type="text/javascript"></script>
<script src="http://localhost:8001/demo/amqp/javascript/AmqpClient.js" type="text/javascript"></script>
<script>
// Constants
@krhoyt
krhoyt / oop-javascript.js
Created December 24, 2014 19:57
Basic OOP template for JavaScript libraries.
// Originally
// http://phrogz.net/js/classes/OOPinJS.html
function Proxy()
{
// Private variables and methods
// Only priveleged
var MY_PRIVATE = "PRIVATE";
var moar_private = null;
@krhoyt
krhoyt / parse-cookie.js
Created February 10, 2015 20:40
Parse a cookie value containing JSON (sent from Node/Express).