Skip to content

Instantly share code, notes, and snippets.

@chazcheadle
chazcheadle / content-dep.html
Created January 13, 2016 19:31
d3 chord diagram of content type interdependencies
<!DOCTYPE html>
<!-- Adapted from mbostock’s block #1046712 June 25, 2011 Chord Diagram-->
<meta charset="utf-8">
<style>
body {
font: 10px sans-serif;
}
@chazcheadle
chazcheadle / enigma-iv.go
Last active January 17, 2016 02:38
Enigma IV Golang
package main
import "fmt"
import "strings"
import "regexp"
var wheels = []*Wheel{}
@chazcheadle
chazcheadle / jsontest3.go
Created January 27, 2016 02:58
Wheel / Side combinations
package main
import "fmt"
import "encoding/json"
var alphabetsJSON = []byte(`[{"Name":"I","Side":{"a":"XGBRCJSQIEFTVHYAPOWZNULKMD","b":"REHKVMQTFSJNXBWZGDOALCUPIY"}},{"Name":"II","Side":{"a":"SUBWDVRFMKHPOLZCGXINQAJEYT","b":"YOBEZALKIHRCUFVQWTSMPXGNJD"}},
{"Name":"III","Side":{"a":"VIWNXUPTCRHJMBZYAKDOLQSEGF","b":"DUSYOCQGZALBKFWHJIVEMPXRNT"}},{"Name":"IV","Side":{"a":"DASQOPELGKUVBTWYRCINHMXJFZ","b":"ZFTIKGOPJLYUDHNMAWVSRECXBQ"}},{"Name":"V","Side":{"a":"OSADNJLUXCRQZTHEVBGFYIPKWM","b":"REHKVMQTFSJNXBWZGDOALCUPIY"}},{"Name":"VI","Side":{"a":"djrifhdhdhdbej","b":"igfjdhfjdj"}}]`)
func main () {
@chazcheadle
chazcheadle / alberti-cipher-disk.html
Created February 17, 2016 12:25
Alberti Cipher Disk in D3
<html>
<head>
<title>Alberti Cipher Disk</title>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
</head>
<body>
<div id="chart"></div>
<script>
var width = 300,
@chazcheadle
chazcheadle / index.html
Last active February 18, 2016 15:35
hab hud
<html>
<head>
<link href='https://fonts.googleapis.com/css?family=Titillium+Web:400,700' rel='stylesheet' type='text/css'>
<style>
body {
background-color: #ccc;
padding: 0;
margin: 0;
font-family: 'Titillium Web', sans-serif;
color: #fff;
@chazcheadle
chazcheadle / charttest.html
Created February 20, 2016 01:33
D3, websockets test
<html>
<head>
<link href='https://fonts.googleapis.com/css?family=Titillium+Web:400,700' rel='stylesheet' type='text/css'>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<style>
</style>
</head>
<body>
@chazcheadle
chazcheadle / websocket.js
Created February 22, 2016 14:43
websocket connection test
var ws = new WebSocket("ws://HOST");
// Display message to confirm a connection has been made.
ws.onopen = function() {
console.log('open');
};
ws.onmessage = function (packet) {
console.log(packet.data);
};
@chazcheadle
chazcheadle / .gitconfig
Created February 22, 2016 16:07
Git aliases
[alias]
lg = log --graph --pretty=format:'%Cred%h%Creset %C(yellow)%an%d%Creset %s %Cgreen(%cr)%Creset' --date=relative
st = status
br = branch
co = checkout
@chazcheadle
chazcheadle / mqtt-tmp36-huzzah.ino
Created February 29, 2016 01:40
mqtt-tmp36-huzzah
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
// Update these with values suitable for your network.
const char* ssid = "";
const char* password = "";
const char* mqtt_server = "";
const int mqtt_port = ;
@chazcheadle
chazcheadle / mqtt-mcp9808-huzzah-feather
Last active March 15, 2018 04:49
Feather Huzzah + MCP9808 temperature sensor + MQTT
#include <FS.h> //this needs to be first, or it all crashes and burns...
#include <Wire.h>
#include <ESP8266WiFi.h> //https://github.com/esp8266/Arduino
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h> //https://github.com/tzapu/WiFiManager
#include <ArduinoJson.h> //https://github.com/bblanchon/ArduinoJson
// MQTT Library
#include <PubSubClient.h>