Skip to content

Instantly share code, notes, and snippets.

View abachman's full-sized avatar
🙌
good times

Adam Bachman abachman

🙌
good times
View GitHub Profile
@abachman
abachman / slack-post
Created September 10, 2018 17:32
slack-post shell script
#!/usr/bin/env bash
###############################################################################
#
# ./slack-post
#
# A script for sending a system message to a channel.
#
# Docs:
#
/***************************************************
Adafruit MQTT Library ESP8266 Example
Must use ESP8266 Arduino from:
https://github.com/esp8266/Arduino
Works great with Adafruit's Huzzah ESP board & Feather
----> https://www.adafruit.com/product/2471
----> https://www.adafruit.com/products/2821
@abachman
abachman / esp8266-Adafruit_MQTT-get-test.ino
Created June 5, 2018 17:34
Demo of the {topic}/get MQTT topic with the Adafruit_MQTT library
/***************************************************
Adafruit MQTT Library ESP8266 Example
Must use ESP8266 Arduino from:
https://github.com/esp8266/Arduino
Works great with Adafruit's Huzzah ESP board & Feather
----> https://www.adafruit.com/product/2471
----> https://www.adafruit.com/products/2821
@abachman
abachman / 000-README.md
Last active November 5, 2022 10:49
FONA 808 + Hologram + Adafruit.io MQTT
@abachman
abachman / esp8266-get-test.ino
Created April 27, 2018 17:05
ESP8266 Arduino sketch w/ memory tracking
// using the new Feed#get() method to trigger MQTT resending
#define IO_USERNAME "abachman"
#define IO_KEY "xxx"
#define WIFI_SSID "normalnet"
#define WIFI_PASS "xxx"
#include "AdafruitIO_WiFi.h"
AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
@abachman
abachman / bg.jpg.base64
Created March 17, 2018 20:03
head mover
/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAICAgICAQICAgICAgIDAwYEAwMDAwcFBQQGCAcICAgHCAgJCg0LCQkMCggICw8LDA0ODg4OCQsQEQ8OEQ0ODg7/2wBDAQICAgMDAwYEBAYOCQgJDg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg7/wAARCANVBEkDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD9Li+9txP51lXu14SPwHNcjc65eBWWJGZ+1ZKapqUshDK65PfNfm9TEq+x9zClZ3udJHOFuDERx61LcLH1UKeO9YiG5XMrqxPalhe5vLrCqyj19q5Vd6WOqVRdGacUh+0Y2hU7k1FqscDIFg+ZyeagnjuI5BHHu3GtCz0uUfvJTknk5reFO+6OSrVu9DldTW6+
@abachman
abachman / esp8266-superbowl.ino
Created March 1, 2018 19:43
ESP8266 Superbowl Scoreboard
// IO Setup
#define IO_USERNAME "xxx"
#define IO_KEY "xxx"
#define WIFI_SSID "xxx"
#define WIFI_PASS "xxx"
#include "AdafruitIO_WiFi.h"
AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
@abachman
abachman / coin-calc.rb
Created February 7, 2018 16:34
cryptocurrency inflation reporter
# My attempt to understand inflation in the mineable cryptocurrency markets.
#
# Every day mineable coins (e.g., Bitcoin, Ethereum, Litecoin, and
# Bitcoin Cash) add coins to their total market cap. Coins are produced by
# mining, miners have real fiat bills, therefore miners have to convert coins
# to fiat in order to continue mining.
#
# Selling new coins into the existing market means an equivalent amount of fiat
# needs to be added in order to keep the price flat. NOTE: selling new coins
# for fiat also requires real-currency markets to be available for exchange,
@abachman
abachman / esp8266-IO_http_and_mqtt.ino
Created January 15, 2018 20:57
esp8266 HTTP and MQTT
#include "ESP8266WiFi.h"
#include "WiFiClientSecure.h"
#include "Adafruit_MQTT.h"
#include "Adafruit_MQTT_Client.h"
#include "ArduinoHttpClient.h"
WiFiClientSecure *http_client = new WiFiClientSecure;
// LED connected to pin 4 (labelled SDA on the Feather Huzzah)
#define LED 4
@abachman
abachman / array-split-join.ino
Created January 11, 2018 20:09
Arduino / C++ simple array split join
/*
* Simple example of string join and split functions for arrays of uint8_t
* values of known length.
*
* Output:
------------------
array split / join
------------------
SENDING >> 52 225 210 170 219