Skip to content

Instantly share code, notes, and snippets.

View thinkyhead's full-sized avatar
🤓
Squashing Marlin bugs.

Scott Lahteine thinkyhead

🤓
Squashing Marlin bugs.
View GitHub Profile
#!/usr/bin/env python
#
# Conway's Game of Life (Three Color Variant)
# Author: @thinkyhead
# Date: 11 Oct 2024
#
# P = PAUSE
# Q = QUIT
# K = CLEAR
# B = SPAWN BLINKERS
@thinkyhead
thinkyhead / _ComfyTerm.md
Last active January 20, 2025 03:54
Imagine with ComfyUI in iTerm2, Ghostty, etc.

ComfyUI Terminal Inline Image

Invoke ComfyUI in a terminal program like Ghostty (Kitty Terminal Graphics Protocol) or iTerm2 (Inline Images Protocol) and display the resulting image inline.

Usage

usage: imagine-v1.py [-h] [--comfyui COMFYUI] [--workflow WORKFLOW] [--model MODEL] [--seed SEED]
                     [--steps STEPS] [--sampler SAMPLER] [--scheduler SCHEDULER]
                     [--negative NEGATIVE] [--ratio RATIO] [--size SIZE] [--width WIDTH]
                     [--height HEIGHT] [--scale SCALE]
                     [prompt]
@thinkyhead
thinkyhead / OpenWebUI-GenerateImage-flux-schnell-fp8.json
Last active December 21, 2024 23:47
ComfyUI FLUX Workflow for Open WebUI
{
"6": {
"inputs": {
"text": "prompt",
"clip": [
"11",
0
]
},
"class_type": "CLIPTextEncode"
@thinkyhead
thinkyhead / OpenWebUI-GenerateImage-LCM.json
Created November 21, 2024 06:02
ComfyUI Workflow for Open WebUI
{
"1": {
"inputs": {
"seed": 0,
"steps": 8,
"cfg": 1.2,
"sampler_name": "lcm",
"scheduler": "normal",
"denoise": 1,
"model": [
@thinkyhead
thinkyhead / termcolor.scpt
Created December 3, 2023 04:14
Randomize Terminal Colors, watch for Appearance change
--
-- termcolor - Set all open Terminal tabs to a random color based on Dark mode
-- Stay open and check for a change in Dark mode every couple of seconds.
-- When Dark Mode changes update the background color of all Terminal tabs.
--
-- To make the exported application into a hidden background app:
-- defaults write /Path/to/termcolor.app/Contents/Info LSUIElement 1
--
-- Thinkyhead - 2 Dec 2023 - CC-NC-BY
--
@thinkyhead
thinkyhead / timer_fun.cpp
Last active November 13, 2017 10:29
A function to set Arduino Timer 5 using the FastIO macros included with Marlin Firmware
/**
* Set Timer 5 PWM frequency in Hz, from 3.8Hz up to ~16MHz
* with a minimum resolution of 100 steps.
*
* DC values -1.0 to 1.0. Negative duty cycle inverts the pulse.
*/
uint16_t set_pwm_frequency_hz(const float &hz, const float dca, const float dcb, const float dcc) {
float count = 0;
if (hz > 0 && (dca || dcb || dcc)) {
count = float(F_CPU) / hz; // 1x prescaler, TOP for 16MHz base freq.
@thinkyhead
thinkyhead / 6502.sublime-syntax
Last active December 31, 2024 11:16
6502 Assembly syntax for Sublime Text
%YAML 1.2
---
#
# 6502 Assembly
#
# 6502 is fairly straightforward, but there are many
# variants, not all of which are easy to take together.
#
# - Code lines have only a few fields, separated by whitespace:
# - Hexdump (e.g., "1234 5C 7F ")
@thinkyhead
thinkyhead / EXPORTER.LST
Created December 31, 2016 09:46
Atari Emulator Send File to Host
.AtariBASIC
.
. Export a file on D: to the host OS by sending it to P:
. Works with Atari800MacX and other Atari 8-bit Computer emulators
.
10 DIM F$(14),N$(12),C$(1),E$(1)
20 C$=CHR$(125):E$=CHR$(155)
30 ? C$;"< ATARI FILE EXPORT >"
40 ? "USES P: TO SEND FILES"
50 ? "TO THE HOST SYSTEM."
@thinkyhead
thinkyhead / SPACEATK.LST
Last active December 31, 2016 09:46
Outer Space Attack by Sheldon Leemon
.AtariBASIC
.
. OUTER SPACE ATTACK V.1 12/81
. By SHELDON LEEMON
. Oak Park, MI 48237
.
10 I=0:J=0:COUNT=0:ATTACK=0:GOSUB 280:GOTO 140
20 . OUTER SPACE ATTACK V.1 12/81
21 . By SHELDON LEEMON
22 . Oak Park, MI 48237
@thinkyhead
thinkyhead / RENUM.LST
Last active December 31, 2016 09:49
Line renumber in Atari BASIC
.
. AtariBASIC RENUM.BAS
. Renumbers lines only, not GOSUB/GOTO.
.
. Corrected version of
. http://www.atarimagazines.com/compute/issue10/042_1_ATARI_BASIC_A_LINE_RENUMBERING_UTILITY.php
.
. To save: L."D:RENUM.LST"
. To run: E."D:RENUM.LST":G.9000
.