Skip to content

Instantly share code, notes, and snippets.

View ology's full-sized avatar
💭
🤔

Gene Boggs ology

💭
🤔
View GitHub Profile
@ology
ology / .out
Created January 8, 2026 05:35
mojo::dom::css
[
[
'tag', 'p', { id => 'a' }, [
'tag', 'div', {}, [ 'root', $_->[0][3] ], $_->[0], [
'tag', 'p', { id => 'b' }, $_->[0][3],
[ 'text', 123, $_->[0][3][5] ],
],
], [ 'text', 'Test', $_->[0] ],
], $_->[0][3][5],
]
@ology
ology / .txt
Created January 6, 2026 09:03
Talking Donkeys
And the Lord spake unto Balaam, saying, “Thou shalt not go with them; thou shalt not curse the people: for they are blessed.” (Numbers 22:12). Yet Balaam’s heart was drawn after the rewards of the world, and he sought to go against the command of the Lord.
And it came to pass that Balaam rose up in the morning and saddled his ass, and went with the princes of Moab. But the anger of God was kindled because he went: and the angel of the Lord stood in the way for an adversary against him. (Numbers 22:21-22). The path of disobedience leads to peril, as Balaam was to discover.
As he rode upon his ass, the ass saw the angel of the Lord standing in the way, with his sword drawn in his hand: and the ass turned aside out of the way, and went into the field: and Balaam smote the ass, to turn her into the way. (Numbers 22:23). The ass, endowed with a wisdom beyond Balaam's understanding, perceived the danger that lay ahead.
Then the Lord opened the mouth of the ass; and she said unto Balaam, “What have I done unto th
@ology
ology / .txt
Created December 31, 2025 21:25
Caddy status
$ sudo systemctl status caddy
× caddy.service - Caddy
Loaded: loaded (/lib/systemd/system/caddy.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2025-12-31 09:35:38 PST; 1min 23s ago
Docs: https://caddyserver.com/docs/
Process: 494088 ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile (code=exited, status=1/FAILURE)
Main PID: 494088 (code=exited, status=1/FAILURE)
Status: "loading new config: http app module: start: listening on :443: listen tcp :443: bind: address already in use"
CPU: 84ms
@ology
ology / .py
Created November 23, 2025 17:43
scaling to integer range in python by hand 🙄
def scale_number(value, original_min, original_max, target_min, target_max):
if original_max == original_min:
return target_min
scaled_value = ((value - original_min) * (target_max - target_min)) / (original_max - original_min) + target_min
return round(scaled_value)
@ology
ology / error.txt
Created September 26, 2025 03:47
Seg fault on 2nd thread?
^C
KeyboardInterrupt detected. Signaling threads to stop...
^CTraceback (most recent call last):
File "/Users/gene/sandbox/Music/midi-threads.py", line 44, in <module>
time.sleep(0.5) # keep main thread alive and respond to interrupts
~~~~~~~~~~^^^^^
KeyboardInterrupt
During handling of the above exception, another exception occurred:
@ology
ology / .py
Last active September 14, 2025 22:47
timedelta
from datetime import datetime, time, date, timedelta
today = date.today()
print(today) # 2025-09-14
my_time = time(10, 30, 0)
print(my_time) # 10:30:00
my_datetime = datetime.combine(today, my_time)
print(my_datetime) # 2025-09-14 10:30:00
duration_to_subtract = timedelta(minutes=30)
print(duration_to_subtract) # 0:30:00
new_datetime = my_datetime - duration_to_subtract
@ology
ology / VoiceGen.py
Created September 4, 2025 18:20
Copilot return from "Convert this Perl module to a Python class:"
import random
from collections import defaultdict
from typing import Callable, List, Dict, Any, Optional
class MusicVoiceGen:
def __init__(self, pitches=None, intervals=None, possibles=None, weightfn=None,
contextfn=None, startfn=None, MAX_CONTEXT=1):
if pitches is not None and intervals is not None:
if not isinstance(pitches, list) or not pitches:
raise ValueError("have no pitches to work with")
@ology
ology / .pas
Last active June 1, 2025 16:35
Beginnings of Delphi12 SQLite DB access
unit Shopping;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, FireDAC.Stan.Intf, FireDAC.Stan.Option,
FireDAC.Stan.Error, FireDAC.UI.Intf, FireDAC.Phys.Intf, FireDAC.Stan.Def,
FireDAC.Stan.Pool, FireDAC.Stan.Async, FireDAC.Phys, FireDAC.Phys.SQLite,
FireDAC.Phys.SQLiteDef, FireDAC.Stan.ExprFuncs, FireDAC.VCLUI.Wait,
@ology
ology / CC.pm
Last active May 25, 2025 08:33
Trying to clock from RtMidi
# ...
sub clock_it ($self, $device, $dt, $event) {
return 0 if $self->running;
$self->running(1);
$self->rtc->send_it(['start']);
$self->rtc->loop->add(
@ology
ology / .pas
Created May 16, 2025 18:26
Pascal's Triangle in Pascal
program PascalsTriangle;
uses crt;
var
triangle: array[1..20, 1..20] of integer;
i, j, n: integer;
begin
clrscr;