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
# clone release branch | |
git clone [email protected]:terra-money/core.git --branch=v0.4.6 | |
# move into dir | |
cd core | |
# build it | |
make install | |
# check that we have the right version... etc |
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
package main | |
import ( | |
"fmt" | |
) | |
type Item struct { | |
TestChan chan int64 | |
} |
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 pandas as pd | |
# view original data here | |
# https://fred.stlouisfed.org/series/M2SL | |
url = "https://fred.stlouisfed.org/graph/fredgraph.csv?bgcolor=%23e1e9f0&chart_type=line&drp=0&fo=open%20sans&graph_bgcolor=%23ffffff&height=450&mode=fred&recession_bars=on&txtcolor=%23444444&ts=12&tts=12&width=968&nt=0&thu=0&trc=0&show_legend=yes&show_axis_titles=yes&show_tooltip=yes&id=M2SL&scale=left&cosd=1959-01-01&coed=2021-01-01&line_color=%234572a7&link_values=false&line_style=solid&mark_type=none&mw=3&lw=2&ost=-99999&oet=99999&mma=0&fml=a&fq=Monthly&fam=avg&fgst=lin&fgsnd=2020-02-01&line_index=1&transformation=lin&vintage_date=2021-03-10&revision_date=2021-03-10&nd=1959-01-01" | |
df = pd.read_csv(url) | |
#### UNCOMMENT TO ACCOUNT FOR 1.9T | |
#new_total = df.tail(1)["M2SL"].values[0] + 1900.0 | |
#df = df.append(pd.DataFrame([["2021-03-10", new_total]], columns = ["DATE", "M2SL"])) |
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 pandas as pd | |
import requests | |
CLIENT_ID = "<CLIENT_ID>" | |
CLIENT_SECRET = "<CLIENT_SECRET>" | |
CLIENT_SCOPE = "emsi_open" | |
VERSION = "latest" | |
url = "https://auth.emsicloud.com/connect/token" | |
payload = f"client_id={CLIENT_ID}&client_secret={CLIENT_SECRET}&grant_type=client_credentials&scope={CLIENT_SCOPE}" |
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 datetime | |
# get the week of the year | |
week_number = datetime.datetime.now().isocalendar()[1] | |
print(f"Its the {week_number} week of the year") | |
# this is True every other week | |
should_update_users = week_number % 2 == 0 | |
if should_update_users: |
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 string | |
# mostly copied form here | |
# https://www.mathsisfun.com/numbers/cardinal-ordinal-chart.html | |
nth = { | |
1: "First", | |
2: "Second", | |
3: "Third", | |
4: "Fourth", | |
5: "Fifth", |
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 |
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
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
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) |