Skip to content

Instantly share code, notes, and snippets.

@jdhenckel
jdhenckel / movies.html
Created November 11, 2026 20:31
List of movies next week
<ul>
<li>
Dune: Part Two
- <a href="https://www.imdb.com/title/tt15239678/">IMDb Main</a>
- <a href="https://www.imdb.com/title/tt15239678/parentalguide/">IMDb Parents Guide</a>
</li>
<li>
Ebenezer
- <a href="https://www.imdb.com/title/tt38773219/">IMDb Main</a>
<ul>
<li>
Dune: Part Two
- <a href="https://www.imdb.com/title/tt15239678/">IMDb Main</a>
- <a href="https://www.imdb.com/title/tt15239678/parentalguide/">IMDb Parents Guide</a>
</li>
<li>
Ebenezer
- <a href="https://www.imdb.com/title/tt38773219/">IMDb Main</a>
@jdhenckel
jdhenckel / gist:39d3df27f240cd190ee50042c04e00a5
Created October 2, 2026 03:13
How to make a variable that changes smoothly in Godot (or any other language)
# The purpose of this is to drive the variable x to the target tx over time.
# the acc is the rate of acceration, it must be positive
class SmoothVar:
var tx:float = 0
var x:float = 0
var v:float = 0
var acc:float = 1
@jdhenckel
jdhenckel / PL2303_USB_Arduino_Demo.cpp
Created July 23, 2023 21:05
Sample code for reading POSTAGE scale with Arduino and USB Host Shield
#include <Arduino.h>
#include <usbhub.h>
#include <cdcprolific.h>
#include <SPI.h>
void print(String a, uint8_t b)
{
Serial.print(a);
Serial.print(' ');
@jdhenckel
jdhenckel / DICOM_Parser.cs
Created November 2, 2022 21:36
Small utility to convert EvilDicomObject into a heirarchy of simple types (dict, list, string, int, double) and eventually serialized to JSON
using EvilDICOM.Core;
using EvilDICOM.Core.Dictionaries;
using System.Text.Json;
using System.Linq;
namespace DotnetDicom
{
internal class Program
{
/// <summary>
@jdhenckel
jdhenckel / madras.js
Created August 29, 2022 18:45
A convenience class for Javascript to read documents from CosmosDB
//=====================
// Service functions for accessing the CosmosDB from the Madras-WDC
//==================
"use strict";
import { CosmosClient } from "@azure/cosmos";
function parseConnectionString(connection_string) {
let result = {};
for (let m of connection_string.matchAll(/(\w+)=(.*?);/g))
@jdhenckel
jdhenckel / WIndowSetup.cs
Last active August 11, 2024 22:00
This is a simple DotNet console application to save/restore desktop window positions and sizes
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.InteropServices;
using Newtonsoft.Json;
using System.IO;
using System.Text.RegularExpressions;
using System.Text;
using System.Threading;
@jdhenckel
jdhenckel / MouseMinder.cs
Last active August 10, 2024 00:53
You can run this in the background and it will move your mouse to a nice location if you leave it idle for long enough time.
using System.Runtime.InteropServices;
using System;
using System.Numerics;
using System.Threading;
namespace MouseMinder
{
/***************
* John Henckel, jdhenckel@gmail.com 1 OCT 2020
*
@jdhenckel
jdhenckel / SQL-DrawIO-README.md
Last active November 13, 2026 15:07
A C# command line program to convert SQL DDL into nice DrawIO diagrams

SQL-DRAWIO

John Henckel, June 2019

This parses the SQL DDL for a database and generates a XML file that is suitable to IMPORT into the https://draw.io

Sql-DrawIO

/*
This can be used in unit tests to simulate a DOM document.
For example, in your jasmine spec file, in the beforeEach, you can do
global.document = new MockElement();
This is not complete. I only implemented the stuff that I needed for my own unit tests.
You should aggressively modify it for your purposes.
*/