Skip to content

Instantly share code, notes, and snippets.

View Magnus167's full-sized avatar
🧘
thinking...

Palash Tyagi Magnus167

🧘
thinking...
View GitHub Profile
@Magnus167
Magnus167 / x.py
Last active November 26, 2025 17:32
def pipeline_sankey_fig_same_rank_terminals(df, show_reached=True):
"""
Plotly Sankey for a monotonic pipeline where multiple stages at the same rank
"end together" as parallel terminal outcomes.
Input df columns:
- stage_rank (int): 0..N in order (can repeat)
- stage (str): stage name
- count (int): users CURRENTLY at that stage
from __future__ import annotations
import re
from typing import Iterable, Optional, Sequence
import polars as pl
from tqdm import tqdm
# ==== Constants ====
FROM python:3.12-slim AS base
RUN pip install uv
ADD requirements.txt .
RUN uv pip install --system --no-cache-dir -r requirements.txt
ADD *.py .
ADD data/ /data/
from flask import Flask, render_template_string
app = Flask(__name__)
APP_URL = "http://localhost:8501/"
TEMPLATE = f"""
<!doctype html>
<html>
<head>
import streamlit as st
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import dash_utils
import concurrent.futures as cf
def calc_errors_page():
import streamlit as st
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# Create sample dataframes for demonstration
DF_CALC = pd.DataFrame(
{
"Name": ["USD_EQXR", "GBP_EQXR", "EUR_CDS", "JPY_CDS", "GOLD_PRICE"],
"Status": [
#!/bin/bash
# Usage: myscript --base branchA --head branchB
# This script iterates through directories starting with "MYREPO" in the current folder,
# checks if they are Git repositories, updates the specified branches, and saves the commit
# diff (with a custom format) into a release info file for each repo.
# Define your repository prefix
PREFIX="MYREPO"
# Parse command-line arguments
@Magnus167
Magnus167 / portainer-templates.json
Created January 3, 2025 11:08
portainer-templates.json. thanks to www.technorabilia.com, github.com/Lissy93, and github.com/Portainer
This file has been truncated, but you can view the full file.
{
"version": "2",
"templates": [
{
"type": 1,
"title": "Adguardhome-sync",
"name": "Adguardhome-sync",
"note": "Portainer App Templates by <a href='https://www.technorabilia.com' target='_blank'>Technorabilia</a> based on data provided by <a href='https://www.linuxserver.io' target='_blank'>LinuxServer.io</a>.</p><p>Don't forget to create the volume directories on the host file system.</p><p>mkdir -p /volume1/docker/adguardhome-sync/config</p>",
"description": "[Adguardhome-sync](https://github.com/bakito/adguardhome-sync/) is a tool to synchronize AdGuardHome config to replica instances.",
"platform": "linux",
@Magnus167
Magnus167 / portainer-templates.json
Created January 3, 2025 11:07
portainer-templates.json.
This file has been truncated, but you can view the full file.
{
"version": "2",
"templates": [
{
"type": 1,
"title": "Adguardhome-sync",
"name": "Adguardhome-sync",
"note": "Portainer App Templates by <a href='https://www.technorabilia.com' target='_blank'>Technorabilia</a> based on data provided by <a href='https://www.linuxserver.io' target='_blank'>LinuxServer.io</a>.</p><p>Don't forget to create the volume directories on the host file system.</p><p>mkdir -p /volume1/docker/adguardhome-sync/config</p>",
"description": "[Adguardhome-sync](https://github.com/bakito/adguardhome-sync/) is a tool to synchronize AdGuardHome config to replica instances.",
"platform": "linux",
net.set_options("""
{
"nodes": {
"font": {
"size": 16
},
"shape": "box"
},
"edges": {
"arrows": {