Skip to content

Instantly share code, notes, and snippets.

View krhoyt's full-sized avatar

Kevin Hoyt krhoyt

View GitHub Profile
@krhoyt
krhoyt / yun-firebase.ino
Last active May 22, 2017 11:10
From Arduino Yun to Firebase (DHT22 temperature and humidity).
// Arduino libraries
#include <Bridge.h>
#include <Console.h>
#include <Process.h>
// Third-party library
// https://github.com/RobTillaart/Arduino
#include <dht.h>
// Literals
@krhoyt
krhoyt / firebase.php
Created December 6, 2014 19:29
Interact with Firebase from PHP.
<?php
// Constants
$FIREBASE = "_YOUR_FIREBASE_URL_";
$NODE_DELETE = "temperature.json";
$NODE_GET = "temperature.json";
$NODE_PATCH = ".json";
$NODE_PUT = "temperature.json";
// Data for PUT
@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 / basic-pubnub.php
Created December 5, 2014 18:13
Basic example of publishing to PubNub from PHP. Really distilled down to just the REST calls.
<?php
$CHANNEL = "iot";
$PUB_KEY = "_YOUR_PUBLISH_KEY_";
$SUB_KEY = "_YOUR_SUBSCRIBE_KEY_";
$SECRET_KEY = "_YOUR_SECRET_KEY_";
$PUBNUB = "http://pubsub.pubnub.com";
$data = array(
"count" => 3
@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 / 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 / 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 / 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 / parse.ino
Last active March 16, 2017 22:55
Arduino Yun to Parse.com (Process, curl).
// Original:
// http://hypernephelist.com/2014/08/19/https_on_arduino_yun.html
// Libraries
#include <Process.h>
// Literals
// #define DEBUG
// Constants
@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