Skip to content

Instantly share code, notes, and snippets.

View ankona's full-sized avatar
🏠
Working from home

Chris McBride ankona

🏠
Working from home
View GitHub Profile
@ankona
ankona / dragon_handshake_seq.mermaid
Last active February 16, 2024 20:15
dragon handshake sequence diagram
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ankona
ankona / dragon_handshake_w_update_loop.mermaid
Last active February 15, 2024 23:31
Dragon handshake + update messages
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ankona
ankona / telemetry.py
Last active February 15, 2024 16:31
0MQ synthetic data publisher
import numpy as np
import time
import zmq
def gen():
min_value = 0
max_value = 2000
normal_dy = 10
@ankona
ankona / slider_demo.py
Last active February 14, 2024 17:51
Demonstration of manipulating graph position w/a slider and buttons
import altair as alt
import streamlit as st
import pandas as pd
import numpy as np
import time
window_size = 10000
@ankona
ankona / placeholder_class_diagram.mermaid
Created February 11, 2024 04:36
placeholder mermaid diagram
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ankona
ankona / gen_and_resample.py
Last active February 2, 2024 21:22
Simple method of resampling an input using diff tracking
import pathlib
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
file_name = pathlib.Path("generated.csv")
def generate(min_value: float, max_value: float, normal_dy: float, num_timesteps, axis) -> None:
@ankona
ankona / seq_diagram_collectors.txt
Last active January 18, 2024 17:14
collectors mermaid seq diagram example
sequenceDiagram
title: Telemetry Collector Sequence Diagram
%%Driver->>Experiment: create experiment
%%Experiment->>Controller: create controller
%%Controller->>JobManager: create job manager
%%Controller->>Launcher: create Launcher
%%JobManager->>TaskManager: create task manager
%%Controller->>TelemetryMonitor: create telemetry monitor
%%TelemetryMonitor->>CollectorManager: create collector manager
%%TelemetryMonitor->>FileWatcher: create file watcher
@ankona
ankona / collectors_erd_mermaid.txt
Last active January 14, 2024 07:30
sample mermaid diagram
%% https://mermaid.live/edit#pako:eNqlVd9r2zAQ_leEIJD-cGGvJuShzQobzQZLn4bBXORLKmKfjKQMQpf87ZMs25GXbE2pXyzdffru00l3euVCFchTLkowZiZhraHKaDRihdQorFTE7p8zelBl6aZKsyT5PWU_sJCmt2U0nLO7O4eZLedYKb17E_agiEKoCPoXag4EayyewWwi0ELSJvgfZYl-ltFJlIx_yji7TpJ21LjjAMGsesBXtfxMVtpdBArxh2TXbnRWcQBNesIgbDQiZZGtHCCG3oNBJsmiXoEIbihLJjqIyfhg7cnuGoLm-I5-9l2LFzRWg8cMuTIK4AB8zYi570bVSOMr9k0RtpY12rzCyliwxnlmUtjDwmpJ60OEEKVEsqU09gSz7yL1Ce2CBQgjqHBose58c1kMjcZi3RgdoV9iap-oOTqvMHnDLLHfSQjZ3IzW4r_JpE_xdHo03xj4hWPQa8NS9uQ2cXA5O8Rp2Mes3S2Lmd9JcXKjIqqkyV-POOTRwfWgKHIFdQQZoxPQp_oqaDmSRetqjTVoHBx342jJxm-rvyC3SY6NklhV7DU-kSnrqva_Iv4pe6BuWBoDhbD0xSDs4PBDBbgUdv3nbJZFqQxepuayJJ40xvgK5BcsP9Mw30dxrptGDK77J23t5SVsybUSndtdHe0yeWrtR0SswHeGpmy3dQHWJ2nhZl9opT5w0Ht_Tfgtr1BXIAv3aDWaM25f0DUSnrphAXrjm9ze4WBr1WJHgqdWb_GWBy3tG8fTFZTGWWugn0od5-5O-OpsX0X_2_8BWRxPSw
classDiagram
%% direction BT
Collector --|> RedisCollector
RedisCollector ..|> DbMemoryCollector
RedisCollector ..|> DbConnectionCollector
Collector ..|> ManagedTaskCollector
Sink ..|> FileSink
RedisCol
@ankona
ankona / context.py
Last active January 9, 2024 16:18
Demo executing a function within a context
import contextvars
import logging
import multiprocessing as mp
import sys
import threading
import typing as t
logging.basicConfig(stream=sys.stdout,
format="%(asctime)s [%(process)d::%(thread)d] %(levelname)s %(name)s %(message)s",
@ankona
ankona / simple_provider_registration.py
Last active August 22, 2023 21:01
Simple demo of dynamically registering a provider to handle a specific event type
import collections
import typing as t
class ServiceProvider:
...
class MessageProvider(t.Protocol):
def write(self, message: str) -> None:
...