Skip to content

Instantly share code, notes, and snippets.

View joedf's full-sized avatar
🦝
Studying geology, materials, and hacking computers

Joe DF joedf

🦝
Studying geology, materials, and hacking computers
View GitHub Profile
@joedf
joedf / extract_pyproject.toml_version.md
Last active August 19, 2025 15:19
How to extract the package version number from a pyproject.toml file

How to extract the package version number from a pyproject.toml file

windows commmand prompt

type pyproject.toml | sed -nr 's/^version\s*[^=]\s*\"(.+)\"$/\1/p'

bash

cat pyproject.toml | sed -nr 's/^version\s*[\^=]\s*"(.+)"$/\1/p'
@joedf
joedf / draw_rect_img.py
Created July 10, 2025 16:37
how to draw a transparent shape on an image in python with pillow
import sys
from PIL import Image, ImageDraw
# test how to draw a transparent shape on an image in python with pillow
G_IMAGE_FILE = '~example.tif'
def drawRect():
# https://pillow.readthedocs.io/en/latest/reference/ImageDraw.html#PIL.ImageDraw.ImageDraw.rectangle
@joedf
joedf / randPoint_radius.py
Created May 21, 2025 16:04
Random points within a circle in python, example output: https://www.desmos.com/calculator/4jdjtilzpl
# ==================================================
# Joachim testing radius pts
# 2025-05-21 11:53:08
import math
import random
def randPoint_radius(radius, origin_x=0, origin_y=0):
# modified from https://stackoverflow.com/a/32277202/883015
@joedf
joedf / SeparateTaskbarButtons.ahk
Created May 13, 2025 13:39
Separate taskbar button per script in AutoHotkey
DllCall("Shell32\SetCurrentProcessExplicitAppUserModelID", "WStr", "CompanyName.ProductName")
@joedf
joedf / getch.py
Last active January 10, 2025 18:04
# --------------------------------------------------
# joedf: modified based on these examples:
# - https://stackoverflow.com/a/47378376/883015
# - https://gist.github.com/jasonrdsouza/1901709
# --------------------------------------------------
def _sys_exit():
# sys.exit()
# quit()
raise KeyboardInterrupt
Bank of America
Cardinal Health
Dream Works
ExxonMobil
Global Payments
Linus Media Group
NHS
Northrop Grumman
Plexus
Samsung
@joedf
joedf / JavaScript GUI libraries.md
Created May 10, 2023 05:44 — forked from SMUsamaShah/List of JavaScript GUI libraries.md
dat.gui alternatives to create GUI from JavaScript object

JavaScript GUI libraries

These libraries can be used to quickly create a GUI for configureable parameters using sliders, checkboxes, colors pickers etc

  1. Tweakpane https://github.com/cocopon/tweakpane Demo: https://cocopon.github.io/tweakpane/
  2. control-panel https://github.com/freeman-lab/control-panel
  3. ControlKit https://github.com/automat/controlkit.js
  4. guify https://github.com/colejd/guify Main site is down, here is the demo https://jons.website/projects/guify/index
  5. oui https://github.com/wearekuva/oui
  6. Palette.js https://github.com/lehni/palette.js
@joedf
joedf / dino_wiki_finance.py
Last active June 18, 2022 16:14
Parse html pages from the Tap Dig MyMuseum fandom wiki...
# by joedf - MIT license - May 2022
from bs4 import BeautifulSoup
import glob, csv
# get html pages from either of these pages
# https://tap-dig-my-museum-wiki.fandom.com/wiki/Fossils
# https://tap-dig-my-museum-wiki.fandom.com/wiki/List_of_fossils
def file2Soup(path, enc="utf8"):
@joedf
joedf / shc2.js
Last active November 30, 2021 04:27 — forked from remi/shc.js
Extract JSON object from https://smarthealth.cards QR code
// modified by joedf from https://gist.github.com/remi/e3aa2f78845ee13f706ed83aead5145f
// Extract JSON payload from SHC QR code (without any kind of private/public key verification)
// Credits + inspiration
// https://github.com/dvci/health-cards-walkthrough/blob/main/SMART%20Health%20Cards.ipynb
// Usage
// $ node shc2.js "shc:/01234569…"
const zlib = require("zlib");
@joedf
joedf / Possibly a Hero.ahk
Created April 3, 2021 23:29
Possibly a Hero.ahk by tidbit
/*
Name: Possibly a Hero
Version 1.20 (Tuesday, March 27, 2018)
Created: (Thu December 20, 2012)
Author: tidbit
Credit:
Hotkeys:
ctrl & w --- Quit (Main window)