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 / 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)
@joedf
joedf / formatXML.js
Last active January 22, 2021 00:00 — forked from kurtsson/formatXML.js
formatXML.js (without jQuery, supports XML empty tags, optionally escape for HTML)
/* pretty-print / beautify XML strings
* Released under the MIT License (MIT)
* Copyright (c) 2021 Joe DF
*
* Modified from (Martin Kurtsson):
* https://gist.github.com/kurtsson/3f1c8efc0ccd549c9e31
*
* which is based on (Stuart Powers):
* https://gist.github.com/sente/1083506
*/
import os
import subprocess
import datetime
def file2str(path):
with open(path, 'r') as file:
return file.read().strip()
def update_badge_html():
command = 'python3 /home/path/to/github-badge-2/src/generate_badge.py'
/* r41nb0w b4rf */
.rainbow {
background: linear-gradient(30deg, red, purple, blue, lime, hotpink, cyan);
padding: 2px;
}
.rainbow {
animation: hue-rotate-fast 2s linear infinite;
box-shadow: 0 0 50px 5px cyan;
}
@keyframes hue-rotate-fast {
@joedf
joedf / specialTitleCase.py
Last active February 18, 2020 22:28
Returns title case avoiding title() 's double captilization of words with hyphens and apotrophes
def specialTitleCase(words):
# written by joedf (Feb. 2020), loosely inspired from https://github.com/gouch/to-title-case
# 1. assumes a list of short words to change to lower case
# 2. assumes short words are preceded by ' ' (or brackets), so that any "starting" ones are still capitalized.
# handle words within brackets
sWords = re.sub(r'[\(\[]',(lambda x:x.group(0)+' '),words)
# Avoid issue of title() capitalizing "2-part" tokens joined by a hyphen on an apostrophe.
# Also allows for "intentional" captilizations
@joedf
joedf / Speech Recognition.ahk
Created February 22, 2019 15:47 — forked from Uberi/Speech Recognition.ahk
Speech recognition with Microsoft's SAPI. A simple SpeechRecognizer class provides a quick and easy way to use speech recognition in your scripts. Inspired by some [prototype code](http://www.autohotkey.com/board/topic/24490-voice-recognition-com/) made a long time ago.
#NoEnv
#Warn All
#Warn LocalSameAsGlobal, Off
#Persistent
/*
Speech Recognition
==================
A class providing access to Microsoft's SAPI. Requires the SAPI SDK.
@joedf
joedf / videocapture.js
Last active April 14, 2018 20:32
generate an image from an HTML5 video element, useful for on-the-go thumbnails
// videocapture.js - MIT License
// credits: joedf (2018/04/10)
// Revision 8 - 2018/04/12
// modified from: https://codepen.io/renanpupin/pen/PqjyeK (Renan Pupin)
/**
* Captures a image frame from the provided video element.
*
* @param {Video} video HTML5 video element from where the image frame will be captured.
* @param {Number} scaleFactor Factor to scale the canvas element that will be return. This is an optional parameter.