version: "3.7"
volumes:
postgres:
services:
rust-service: # in the same network by default in docker-compose?
This file contains 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 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 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 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 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 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 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 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 | |
}, | |
{ |
This file contains 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
#![no_main] | |
#![no_std] | |
use panic_probe as _; | |
use core::{cell::RefCell, ops::Deref}; | |
use cortex_m::interrupt::{Mutex, free}; | |
use cortex_m_rt::entry; | |
use stm32f4xx_hal::{ | |
gpio::{Alternate, PA8, PC6}, | |
pac::{interrupt, Interrupt, Peripherals, TIM1, TIM8}, |