Skip to content

Instantly share code, notes, and snippets.

View drbh's full-sized avatar
🕳️
a for AI

drbh drbh

🕳️
a for AI
  • drbh
  • state space
  • 04:29 (UTC -04:00)
  • LinkedIn in/drbh
View GitHub Profile
@drbh
drbh / app.ipynb
Created December 11, 2019 02:51
Checking out the VIX performance by comparing weekly changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@drbh
drbh / explore.ipynb
Created January 3, 2020 00:40
Create some fake person spending data and get weekly and monthly summaries in a notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
### Keybase proof
I hereby claim:
* I am drbh on github.
* I am drbh (https://keybase.io/drbh) on keybase.
* I have a public key ASBjal2m3iJOdayg_el6CbiP0F7wTd4I23tUu64PeAkcGwo
To claim this, I am signing this object:
@drbh
drbh / jagged-loops.js
Last active April 3, 2020 19:28
Make circles and skew the points for jagged loops
const range = (start, end, length = end - start) =>
Array.from({ length }, (_, i) => start + i);
const randomNumber = (min, max) => {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min + 1)) + min;
}
const points_in_circle = (r, n) => {
@drbh
drbh / typed-hash-tree-construction.ipynb
Created April 17, 2020 18:29
typed-hash-tree-construction.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@drbh
drbh / typed-hash-tree-construction_v2.ipynb
Last active April 17, 2020 19:44
WIP implementation of typed hash tree
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@drbh
drbh / read-door-state.py
Created July 26, 2020 00:41
Get human readable state of the door from dynamo table
import json
import boto3
import decimal
import datetime
import calendar
class DecimalEncoder(json.JSONEncoder):
def default(self, o):
if isinstance(o, decimal.Decimal):
return float(o)
@drbh
drbh / write-door-state.py
Created July 26, 2020 00:44
Write door state updates to dynamo
import json
import boto3
import datetime
import dateutil.tz
eastern = dateutil.tz.gettz('US/Eastern')
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table("<DOOR-STATE-TABLE-NAME>")
def lambda_handler(event, context):
@drbh
drbh / door-state-tracker.cpp
Created July 26, 2020 00:58
Deep sleep enabled door state tracker that connects to WIFI and sends HTTPS request if state is changed. build target: WEMOS D1 ESP8266
// memory
#include <EEPROM.h>
// networking
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#include <ESP8266WebServer.h>
#include <ESP8266HTTPClient.h>
#include <ArduinoJson.h>
@drbh
drbh / door-state-tracker-naive.cpp
Created July 26, 2020 01:03
Simple door state checker - truncated to ignore networking code
#include <ESP8266WiFi.h>
#include <EEPROM.h>
// networking and request related
int inputVal = 0;
int addr = 0;
int lastValue;
// networking and request related
void sendMessageToLambda(int currentState) {
// networking and request related