Skip to content

Instantly share code, notes, and snippets.

View aaroneiche's full-sized avatar

Aaron Eiche aaroneiche

View GitHub Profile
@aaroneiche
aaroneiche / Javascript Binary operations
Last active April 17, 2019 17:10
Some experiments in manipulating bytes for an LED Driver. Javascript because it's fast and easy.
/*
I wrote this to do some experimentation on
bit manipulation. I'm faster in Javascript than I am in C
and this let me work out the logic for shifting
the bits into the right positions.
The goal was to turn an integer into an on/off state
for the NXP9532D - an LED driver.
(https://www.nxp.com/docs/en/data-sheet/PCA9532.pdf - see page 8)
function myfunc(arg,arg2,arg3,arg4){
console.log(arg);
console.log(arg2);
console.log(arg3);
console.log(arg4);
}
myfunc("test","test2","test3","test4"); //The typical way to do it.
@aaroneiche
aaroneiche / police_parser.js
Created March 31, 2017 18:00
A simple node script for parsing a Police Dispatch webpage.
'use strict'
var $ = require('cheerio')
var request = require('request')
function gotHTML(err, resp, html) {
if (err) return console.error(err)
var parsedHTML = $.load(html)
parsedHTML("tr td").map(function(i,td){
@aaroneiche
aaroneiche / OberonSecure.js
Created March 2, 2017 22:39
Oberon Smart Home Server - A very simply web server intended to send incoming requests from an Amazon Echo and fire off the associated tasks.
var https = require('https');
var fs = require('fs');
var mqtt = require('mqtt');
var mqttOptions = {
"username": "oberon",
"password": "titania"
}

Keybase proof

I hereby claim:

  • I am aaroneiche on github.
  • I am aeiche (https://keybase.io/aeiche) on keybase.
  • I have a public key ASDag7A314g81dvfWRswy0XnXiYG03PdkmTWChQwOpABqgo

To claim this, I am signing this object:

@aaroneiche
aaroneiche / WirelessOutletControl.ino
Last active December 13, 2017 12:16
Wireless outlet control for Arduino
/**
* Wireless Outlet Control
*
* (c) 2016 Aaron Eiche, released under MIT License
* Use it, have fun with it.
*
* Built for my existing wireless outlets, written in Arduino
* Uses a common, inexpensive transmitter. 315Mhz or 433Mhz are typical.
* You'll need to determine codes for your own outlets.
*