Skip to content

Instantly share code, notes, and snippets.

@cwebber314
cwebber314 / thread_pool_playground.py
Created June 16, 2026 03:11
Playing around with a threadpool to make I/O bound slow API calls run in parallel
"""Mock example: parallelizing slow API calls with ThreadPoolExecutor.
The real bottleneck is a slow API library (network I/O), so threads work well:
Python releases the GIL while a thread waits on the network, letting all the
branch fetches happen concurrently.
Each mock call sleeps a random amount (up to MAX_SLEEP) to stand in for a slow
API call. Live logging + an ASCII timeline at the end let you *see* the threads
overlap.
"""
@cwebber314
cwebber314 / panel_example.py
Created June 26, 2025 22:42
Example of a simple app with panel
"""Panel demo
Install panel
pip install panel
Run the app:
panel serve app.py --dev
"""
Hello World
@cwebber314
cwebber314 / esri-map-geojson.markdown
Created September 27, 2024 21:44
ESRI Map - GeoJSON
<script type="importmap">
{
"imports":
{
"vue": "https://cdnjs.cloudflare.com/ajax/libs/vue/3.4.38/vue.esm-browser.min.js",
"vuetify": "https://unpkg.com/vuetify@3.1.10/dist/vuetify.esm.js"
}
}
</script>
<title>Network Diagram Demo</title>
@cwebber314
cwebber314 / forever_ping_powershell.ps1
Created October 29, 2023 17:50
Use powershell to run connection test on google DNS
Test-Connection 8.8.8.8 -Delay 30 -Count ([int32]::MaxValue) | format-table @{n='TimeStamp';e={Get-Date}},Ping, Source, Address, Latency, Status | Out-File ping.txt
@cwebber314
cwebber314 / index.html
Created October 25, 2023 14:20
ROW Orientation - by section
<div id="app">
<v-app>
<v-main>
<v-container fluid>
<v-row>
<v-col cols=12>
<v-card class="mb-4">
<v-card-title>
Tower Config
</v-card-title>
@cwebber314
cwebber314 / PSSE_Environment_debug.md
Last active January 22, 2025 20:45
PSSE Environment Debug Notes

PSSE Environment Debug

Sometimes a PSSE won't open after install. This is almost always caused by an unexpected Python configuration.

If you're struggling with MOD, see the MOD Debug Notes

Debug: Instant close

Behavior:

@cwebber314
cwebber314 / PSSE_MOD_notes.md
Last active April 23, 2026 20:33
Notes on getting PSSE and MOD to play nice with your python environment

PSSE MOD Debug Notes

MOD File Builder often has trouble connecting to the PSSE API if the environment on your machine isn't exactly like PSSE/MOD expects.

This document show some common issues with MOD File Builder install and how to fix them.

If you can't get PSSE to open without MOD, you need to debug that first. Here are some PSSE Debug Notes

The GUI and the Bridge

// Generate a Sankey diagram from a savnw case solve.
// Values are entered by hand, so probably not accurate.
// Loads are not shown so it looks like Kirchoff is violated
// https://sankeymatic.com/build/
//
// Enter Flows between Nodes, like this:
// Source [AMOUNT] Target
MINE G [260] MINE
HYDRO G [600] HYDRO