Skip to content

Instantly share code, notes, and snippets.

View ology's full-sized avatar
💭
🤔

Gene Boggs ology

💭
🤔
View GitHub Profile
@ology
ology / mysqld.t
Last active January 19, 2019 06:52
A working Test::mysqld example on my local machine
#!/usr/bin/env perl
use strict;
use warnings;
use DBI;
use Test::mysqld;
use Test::More;
my $mysqld = Test::mysqld->new(
my_cnf => {
@ology
ology / git-when.txt
Created April 2, 2020 20:02
A cool metric
git log --author="Your Name" --date=iso | perl -nalE 'if (/^Date:\s+[\d-]{10}\s(\d{2})/) { say $1+0 }' | sort | uniq -c|perl -MList::Util=max,sum0 -nalE '$h{$F[1]} = $F[0]; }{ $m = max values %h; for (0..23) { $h{$_} = 0 if not exists $h{$_} } for (sort {$a <=> $b } keys %h) { say sprintf "%02d - %4d %s", $_, $h{$_}, "*" x ($h{$_} / $m * 50); } say sum0(values %h), " commits"'
@ology
ology / dbi-websocket.pl
Created July 23, 2020 19:06
DBI + Mojolicious::Lite websocket app
#!/usr/bin/env perl
# https://github.com/mojolicious/mojo/wiki/Writing-websocket-chat-using-Mojolicious-Lite
# +
# http://blogs.perl.org/users/joel_berger/2012/10/a-websocket-mojoliciousdbi-example.html
use Mojolicious::Lite;
use Mojo::JSON qw(decode_json encode_json);
# Connected websocket clients
@ology
ology / shire.bmp
Last active January 6, 2021 15:09
Windows Shire Time Display
http://ology.net/tmp/shire.bmp
@ology
ology / blue-monk.pl
Last active May 3, 2021 20:19
Blue Monk MIDI-Perl
#!/usr/bin/env perl
use strict;
use warnings;
use MIDI::Drummer::Tiny;
use MIDI::Chord::Guitar;
use MIDI::Praxis::Variation qw(tie_durations);
use MIDI::Util qw(set_chan_patch);
my $d = MIDI::Drummer::Tiny->new(
@ology
ology / audio-player2.pl
Created August 7, 2021 06:26
Mojo::File->realpath returns "" ?
app->minion->add_task(reencode_audio => sub ($job, @args) {
my $track = Mojo::File->new($args[0]);
my $path = eval { $track->realpath };
$job->app->log->debug($track, 'to', $path);
(my $outfile = $path) =~ s/^(.+?)\.\w+$/$1.mp3/;
my @cmd = (qw(ffmpeg -i), qq/"$path"/, qw(-c:v copy -c:a libmp3lame -q:a 4), qq/"$outfile"/);
$job->app->log->debug("@cmd");
# if(system(@cmd) == 0) {
# $job->app->log->debug($track, 're-encoded');
# }
@ology
ology / .email
Last active February 9, 2022 00:29
This guy comes out of the woodwork after 17 years!
Mr Boggs,
As you well know, and can verify with the following link,
https://metacpan.org/dist/MIDI-Praxis-Variation
as it’s undisputed author, I am the copyright holder on this software.
You will immediately remove your false claim, arrogating copyright unto yourself,
that appears in the latest versions where you are named as maintainer.
You will furthermore stop pilfering bits of it, calling them your own,
@ology
ology / .out
Created July 27, 2022 01:02
portmidi install attempt error - help?
[2022-07-26 17:54:06] gene@mopey:~/Downloads/portmidi
▸ make
Consolidate compiler generated dependencies of target portmidi
[ 17%] Built target portmidi
[ 19%] Building C object pm_test/CMakeFiles/testio.dir/testio.c.o
[ 21%] Linking C executable testio
[ 21%] Built target testio
[ 23%] Building C object pm_test/CMakeFiles/midithread.dir/midithread.c.o
[ 25%] Linking C executable midithread
[ 25%] Built target midithread
@ology
ology / .pl
Created August 21, 2022 07:08
Laws of Thought
#!/usr/bin/env perl
use constant A => 1;
print "Identity\n"
if A == A;
print "Non-contradiction\n"
if A != !A;
print "Excluded middle\n"
if !(A && !A);
@ology
ology / .out
Created August 28, 2022 14:12
Subject: FAIL Music-Chord-Progression-0.0602 5.20.0 GNU/Linux
Report for Music-Chord-Progression-0.0602
Back
From: Nedzad Hrnjica
Subject: FAIL Music-Chord-Progression-0.0602 5.20.0 GNU/Linux
Date: 2022-08-27T18:06:35Z
This distribution has been tested as part of the CPAN Testers
project, supporting the Perl programming language. See
http://wiki.cpantesters.org/ for more information or email
questions to [email protected]