Skip to content

Instantly share code, notes, and snippets.

View ology's full-sized avatar
💭
🤔

Gene Boggs ology

💭
🤔
View GitHub Profile
@ology
ology / clock.py
Created March 29, 2026 16:56
asyncio interval not firing exactly on time?
import asyncio
import mido
from mido import Message
import sys
def periodic_task(loop, interval, task_func):
task_func()
# Schedule the next call recursively
loop.call_later(interval, periodic_task, loop, interval, task_func)
@ology
ology / errors.txt
Created March 28, 2026 01:33
hugo barfs - hints? :)
gene@zappa:~/repos/perldotcom master> hugo server --buildDrafts --buildFuture
Watching for changes in /Users/gene/repos/perldotcom/content/{article,json,legacy}, /Users/gene/repos/perldotcom/data/author, /Users/gene/repos/perldotcom/layouts/{_default,about,latest_articles,partials,shortcodes,...}, /Users/gene/repos/perldotcom/package.json, /Users/gene/repos/perldotcom/static/{css,fonts,images,media,widget}
Watching for config changes in /Users/gene/repos/perldotcom/hugo.toml
Start building sites …
hugo v0.159.1+extended+withdeploy darwin/arm64 BuildDate=2026-03-26T09:54:15Z VendorInfo=Homebrew
WARN deprecated: .Site.Data was deprecated in Hugo v0.156.0 and will be removed in a future release. Use hugo.Data instead.
Built in 2238 ms
ERROR error building site: render: [en v1.0.0 guest] failed to render pages: render of "/authors/adam-kennedy" failed: "/Users/gene/repos/perldotcom/layouts/_default/rss.xml:8:50": execute of template failed: template: rss.xml:8:50: executing "rss.xml" at <.Site.Author.email>: ca
@ology
ology / clock.pl
Created March 26, 2026 17:42
How to add an independent process (like sleep(2); say "Hello";) to this code?
#!/usr/bin/env perl
# Clock an external MIDI device, like a drum machine or sequencer.
# Example: perl clock-gen-async.pl usb 90
use v5.36;
use IO::Async::Loop ();
use IO::Async::Timer::Periodic ();
use MIDI::RtMidi::FFI::Device ();
@ology
ology / .pl
Last active March 26, 2026 16:19
IO::Async::Process exit code 256? Why?
#!/usr/bin/env perl
use v5.36;
use IO::Async::Loop ();
use IO::Async::Process ();
use IO::Async::Timer::Periodic ();
my $loop = IO::Async::Loop->new;
my $timer = IO::Async::Timer::Periodic->new(
@ology
ology / start-stop.pl
Last active March 20, 2026 13:56
start/stop the sequence of a midi device
#!/usr/bin/env perl
use v5.36;
use MIDI::RtMidi::FFI::Device ();
use Time::HiRes qw(sleep);
my $name = shift || 'SE-02'; # MIDI sequencer device
my $bpm = shift || 120;
my $interval = 60 / $bpm / 24;
@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],
]