version: "3.7"
volumes:
postgres:
services:
rust-service: # in the same network by default in docker-compose?
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
/* | |
scrape from https://www.espn.com/nba/playbyplay/_/gameId/401547671 with | |
const quarter = document.querySelector('.tabs__wrapper--playByPlay .tabs__list__item--active').innerText | |
const rows = document.querySelectorAll('.playByPlay__tableRow') | |
const plays = [] | |
for (const row of rows) { | |
const index = row.attributes['data-idx'] | |
const time = row.querySelector('.playByPlay__time').innerText | |
const text = row.querySelector('.playByPlay__text').innerText | |
const awayScore = row.querySelector('.playByPlay__score--away').innerText |
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
[{"direction":"Long","timestamp":"01/19/2023 09:40:00 AM"},{"direction":"Short","timestamp":"01/19/2023 09:48:00 AM"},{"direction":"Long","timestamp":"01/19/2023 10:08:00 AM"},{"direction":"Short","timestamp":"01/19/2023 10:12:00 AM"},{"direction":"Long","timestamp":"01/19/2023 11:08:00 AM"},{"direction":"Short","timestamp":"01/19/2023 11:28:00 AM"},{"direction":"Long","timestamp":"01/19/2023 12:00:00 PM"},{"direction":"Short","timestamp":"01/19/2023 12:24:00 PM"},{"direction":"Long","timestamp":"01/19/2023 12:59:00 PM"},{"direction":"Short","timestamp":"01/19/2023 01:51:00 PM"},{"direction":"Long","timestamp":"01/19/2023 02:15:00 PM"},{"direction":"Short","timestamp":"01/19/2023 02:54:00 PM"},{"direction":"Long","timestamp":"01/18/2023 09:40:00 AM"},{"direction":"Short","timestamp":"01/18/2023 10:18:00 AM"},{"direction":"Long","timestamp":"01/18/2023 01:26:00 PM"},{"direction":"Short","timestamp":"01/18/2023 02:02:00 PM"},{"direction":"Long","timestamp":"01/18/2023 02:28:00 PM"},{"direction":"Short","timesta |
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
provider "kubernetes" { | |
config_path = "~/.kube/config" | |
config_context = "docker-desktop" | |
} | |
provider "helm" { | |
kubernetes { | |
config_path = "~/.kube/config" | |
config_context = "docker-desktop" | |
} |
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
#!/bin/bash | |
# install qemu | |
brew update --auto-update | |
brew install qemu | |
# install macpine | |
wget https://github.com/beringresearch/macpine/releases/download/v.06/alpine_darwin_arm64 | |
mv alpine_darwin_arm64 alpine | |
chmod +x alpine | |
sudo mv alpine /usr/local/bin/ | |
# use alpine to launch debian VM |
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
use log::warn; | |
use std::future::Future; | |
pub async fn timeout_wrapper<Fut, T>(timeout_ms: u64, cb: &impl Fn() -> Fut) -> Result<T, String> | |
where | |
Fut: Future<Output = Result<T, String>>, | |
{ | |
let request_future = cb(); | |
let timeout_future = tokio::time::timeout(tokio::time::Duration::from_millis(timeout_ms), request_future).await; | |
if timeout_future.is_err() { |
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
/* | |
export AWS_ACCESS_KEY_ID="..." | |
export AWS_SECRET_ACCESS_KEY="..." | |
export AWS_DEFAULT_REGION="eu-central-1" | |
export TF_VAR_public_key=$(ssh-keygen -y -f ../assets/ssh-private-key.pem) | |
*/ | |
terraform { | |
required_providers { | |
aws = { |
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
typedef enum { | |
BC_ISLT, | |
BC_ISGE, | |
BC_ISLE, | |
BC_ISGT, | |
BC_ISEQV, | |
BC_ISNEV, | |
BC_ISEQS, | |
BC_ISNES, | |
BC_ISEQN, |
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 zlib from 'zlib' | |
import fs from 'fs' | |
class JSONBrotliAdapter { | |
constructor(filename) { | |
this.filename = filename | |
} | |
async read() { | |
let compressedData = null |
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
[ | |
{ | |
"timestamp": "07/26/2021 10:40:00 AM", | |
"direction": "short", | |
"expectedExit": "07/26/2021 11:30:00 AM", | |
"expectedOpenPrice": 439.59666666666664, | |
"expectedExitPrice": 440.4116333333333, | |
"expectedProfitLoss": -407.48333333334585 | |
}, | |
{ |