Skip to content

Instantly share code, notes, and snippets.


Tom Robinson tlrobinson

View GitHub Profile
tlrobinson /
Created Apr 23, 2020
evaluate and export .env files
# evaluates .env and exports all variables inside of it
source .env && export $(grep -oE "^[^=]+" .env)
tlrobinson / ttgo_oled_example.ino
Last active Jan 5, 2020
Using the OLED display on TTGO LoRa32 development boards and "ESP8266 and ESP32 OLED driver for SSD1306 displays" library
View ttgo_oled_example.ino
#include <Wire.h> // Only needed for Arduino 1.6.5 and earlier
#include "SSD1306Wire.h" // legacy: #include "SSD1306.h"
// TTGO LoRa32-OLED V1
// #define OLED_SDA 4
// #define OLED_SCL 15
// #define OLED_RST 16
// TTGO LoRa32-OLED v2.0 and V2.1
tlrobinson /
Last active Sep 30, 2019
Metabase immutable wrapper classes


  • "Base" base class
  • copies properties
  • also includes "_plainObject"
  • external logic sets up references, lame: "metabase/selectors/metadata"


  • "Dimension" base class, encode each clause as a different subclass
  • also includes optional "_parent" (actually a child in the tree, i.e. ["field-id", 1] is a _parent in ["datetime-field", ["field-id", 1], "month"]) and "_args" which are rest of clause args (month the datetime-field or 1 in the field-id)
  • also includes "_metadata" and "_query" properties
tlrobinson / geiger.ino
Last active Sep 12, 2019
MightyOhm Geiger Counter Kit + ESP8266 (WEMOS D1 mini)
View geiger.ino
// get config.h from Adafruit IO example sketch and fill in your details
#include "config.h"
#include <Pins_Arduino.h>
#include <SoftwareSerial.h>
#include <Regexp.h>
AdafruitIO_Feed *cpm_feed = io.feed("Geiger CPM");
AdafruitIO_Feed *cps_feed = io.feed("Geiger CPS");
AdafruitIO_Feed *usv_feed = io.feed("Geiger uSv/hr");
tlrobinson /
Last active Apr 14, 2021
ham radio / amateur radio setup notes for mac and raspberry pi
#!/usr/bin/env bash
# e.x.
# KE6JJJ-1 1200 145090000
# KE6JJJ-1 9600 433370000
set -eu
tlrobinson /
Last active Mar 6, 2019
Polished Single Page Web Application Concerns
  • loading and error states
  • form validation/errors + dirty/invalid states
  • empty states
  • pagination and/or virtualization/windowing of large lists
  • normalizing state to ensure consistency
  • caching requests / cache invalidation
  • immediate feedback: optimistic updates and/or loading states
  • blocking duplicate actions (loading/dirty states for SPA, POST/redirect/GET for non-SPA)
  • cancelling pending requests when making an updated request (e.x. typeahead), or when navigating away from the screen that depends on it
  • keyboard/mouse events:
tlrobinson /
Created Jan 21, 2019
Script for listing the Docker build context of the current directory
#!/usr/bin/env bash
set -eu
docker build --no-cache -t $tag -f - . <<EOD
FROM busybox
RUN mkdir /_/
View gist:ab0ab25a17793427410552923ea546aa
Devices {
devices {
AirDataLatest(uuid: "awair-...") {
airDataSeq {
View docker-machine-push
#!/usr/bin/env bash
set -eu
MONITOR=$(command -v pv || echo cat)
docker save $IMAGE | bzip2 | $MONITOR | docker-machine ssh $MACHINE 'bunzip2 | docker load'