Skip to content

Instantly share code, notes, and snippets.

View ology's full-sized avatar
💭
🤔

Gene Boggs ology

💭
🤔
View GitHub Profile
@ology
ology / find.pl
Last active March 5, 2023 18:46
File::Find::Rule->file()->...->size(...) error?
#!/usr/bin/env perl
use strict;
use warnings;
use File::Find::Rule ();
my @files = File::Find::Rule
->file()
->name('image*.jpg')
->in('/home/gene/tmp/pi')
@ology
ology / process.pl
Last active December 14, 2022 18:26
Process F1 & F2 into F3 text files
#!usr/bin/env perl
use strict;
use warnings;
my $F1 = 'F1.txt';
my $F2 = 'F2.txt';
my $F3 = 'F3.txt';
my %f2_map;
@ology
ology / .pl
Last active December 8, 2022 23:42
My $0.02 :)
my @post_links = map {
$self->url_for(
'single_' . $_->{type},
$_->{type} . '_id' => $link->{id}
)
} @$flagged_posts;
$self->stash(post_links => \@post_links);
@ology
ology / .pl
Last active November 26, 2022 15:50
Turning any sharps into flats
sub accidental {
my ($x) = @_; # note or chord
if ($x =~ /^([A-G]#)(.*)?$/) {
my $note = $1;
my $flav = $2;
my $mn = Music::Note->new($note, 'isobase');
$mn->en_eq('b');
$x = $mn->format('isobase');
$x .= $flav if $flav;
}
@ology
ology / .release
Created October 23, 2022 17:37
A t/control.mid file is shipped with the module, but causes an ugly failure?
[2022-10-23 10:13:51] gene@mopey:~/sandbox/MIDI-Tab master
▸ dzil release
[DZ] beginning to build MIDI-Tab
[DZ] guessing dist's main_module is lib/MIDI/Tab.pm
[VersionFromModule] dist version 0.0402 (from lib/MIDI/Tab.pm)
[PkgVersion] skipping lib/MIDI/Tab.pm: assigns to $VERSION
[ExtraTests] rewriting author test xt/author/pod-coverage.t
[ExtraTests] rewriting author test xt/author/pod-syntax.t
[ExtraTests] rewriting author test xt/author/no-tabs.t
[ExtraTests] rewriting author test xt/author/eol.t
@ology
ology / Athena.pm
Created September 27, 2022 18:55
Code taken from the athena.pl Paws distro example
package Compliance::Athena;
# Abstract: AWS Athena database connection
use strict;
use warnings;
use Compliance::Config;
use Carp qw/croak/;
@ology
ology / .perlbot
Created September 13, 2022 00:32
random slice of perlbot
17:29:12 -!- Irssi: Starting query in libera with perlbot
17:29:12 ology> talk like a pirate
17:29:12 perlbot> No factoid found. Did you mean one of these: [_tld_list] [tools] [teal`c] [typeglob] [polyglot] [talk to buu] [blackletter] [file::slurp] [class::light] [placeholders]
17:29:23 ology> pirate
17:29:23 perlbot> No factoid found. Did you mean one of these: [parrot] [pbride] [port 0] [port 1] [port 2] [port 3] [port 5] [port 7] [port 9] [port 11]
17:29:32 ology> Bite me!
17:29:33 perlbot> No factoid found. Did you mean one of these: [bottom] [button] [blow me] [bidi] [.bd] [.bt] [bad] [bot] [mdn] [8bit]
17:29:39 ology> blow me
17:29:40 perlbot> alright.
@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]
@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 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