Skip to content

Instantly share code, notes, and snippets.

View ology's full-sized avatar
💭
🤔

Gene Boggs ology

💭
🤔
View GitHub Profile
@ology
ology / .pl
Created February 24, 2026 16:52
rtcontroller test
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
use_ok 'MIDI::RtController';
# SKIP: {
# skip 'live test', 7;
@ology
ology / .txt
Created February 24, 2026 16:44
rtmidi make problems
gene@zappa:~/Downloads/MIDI-RtMidi-FFI-0.09_001> make
cp FFI/rtmidi-ffi.fbx blib/lib/MIDI/RtMidi/FFI/rtmidi-ffi.fbx
cp FFI/pipefd.cpp blib/lib/MIDI/RtMidi/FFI/pipefd.cpp
cp lib/MIDI/RtMidi/FFI/Device/Out.pm blib/lib/MIDI/RtMidi/FFI/Device/Out.pm
cp lib/MIDI/RtMidi/FFI/AbstractDevice.pm blib/lib/MIDI/RtMidi/FFI/AbstractDevice.pm
cp lib/MIDI/RtMidi/FFI/Device/In.pm blib/lib/MIDI/RtMidi/FFI/Device/In.pm
cp lib/MIDI/RtMidi/FFI/Device.pm blib/lib/MIDI/RtMidi/FFI/Device.pm
cp lib/MIDI/RtMidi/FFI.pm blib/lib/MIDI/RtMidi/FFI.pm
"/Users/gene/perl5/perlbrew/perls/perl-5.38.0/bin/perl" -MFFI::Build::MM=cmd -e fbx_build
+c++ -I/Users/gene/perl5/perlbrew/perls/perl-5.38.0/lib/site_perl/5.38.0/darwin-2level/auto/share/dist/Alien-RtMidi/include/rtmidi -fno-common -DPERL_DARWIN -mmacosx-version-min=13.4 -DNO_POSIX_2008_LOCALE -fno-strict-aliasing -pipe -fstack-protector-strong -O3 -I/Users/gene/perl5/perlbrew/perls/perl-5.38.0/lib/site_perl/5.38.0/darwin-2level/auto/share/dist/FFI-Platypus/include -pthread -D__MACOSX_CORE__
@ology
ology / errors.txt
Last active February 19, 2026 19:17
1st attempt at MIDI::RtMidi::FFI install on Mac 15.7.4
gene@zappa:~> cpanm MIDI::RtMidi::FFI --dev
cpanm (App::cpanminus) 1.7047 on perl 5.038000 built for darwin-2level
Work directory is /Users/gene/.cpanm/work/1771528590.31893
You have make /usr/bin/make
You have LWP 6.72
You have /usr/bin/tar: bsdtar 3.5.3 - libarchive 3.7.4 zlib/1.2.12 liblzma/5.4.3 bz2lib/1.0.8
You have /usr/bin/unzip
--> Working on MIDI::RtMidi::FFI
Fetching http://cpan.metacpan.org/authors/id/J/JB/JBARRETT/MIDI-RtMidi-FFI-0.09-TRIAL.tar.gz ... OK
Unpacking MIDI-RtMidi-FFI-0.09-TRIAL.tar.gz
@ology
ology / .txt
Created January 15, 2026 08:33
Musical particle swarm optimization output
gene@zappa:~/sandbox/Music master> perl pso-music.pl
1. Optimized Chord: C4-A4-E5
Final Dissonance Score: 12 (Lower is more consonant)
2. Optimized Chord: C4-G4-E5
Final Dissonance Score: 12 (Lower is more consonant)
3. Optimized Chord: G4-C5-E5
Final Dissonance Score: 13 (Lower is more consonant)
4. Optimized Chord: F4-D5-A5
Final Dissonance Score: 12 (Lower is more consonant)
5. Optimized Chord: F4-D5-A5
@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