Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### 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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) => { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // memory | |
| #include <EEPROM.h> | |
| // networking | |
| #include <ESP8266WiFi.h> | |
| #include <WiFiClientSecure.h> | |
| #include <ESP8266WebServer.h> | |
| #include <ESP8266HTTPClient.h> | |
| #include <ArduinoJson.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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 |