Skip to content

Instantly share code, notes, and snippets.

View ology's full-sized avatar
💭
🤔

Gene Boggs ology

💭
🤔
View GitHub Profile
@ology
ology / octatonic.pl
Last active October 12, 2023 06:12
ology's version of octatonic
#!/usr/bin/env perl
use strict;
use warnings;
package ChordExtra;
use Role::Tiny;
# chord intervals as relative to the previous note in the chord
sub chord_intervals {
my ($self, $name) = @_;
@ology
ology / route.pl
Created August 8, 2023 13:22
Can't get the /*img route to work - help?
#!/usr/bin/env perl
use Mojolicious::Lite -signatures;
use Mojo::File ();
get '/' => sub ($c) {
$c->render(template => 'index');
};
get '/album/*img' => sub ($c) {
@ology
ology / AuthEg.pm
Last active August 6, 2023 17:09
Mojo route does not fire?
sub startup ($self) {
$self->plugin('RemoteAddr');
$self->plugin('browser_detect');
$self->plugin('Thumbnail');
$self->plugin('AuthEg::Plugin');
$self->plugin('AuthEg::DB::Plugin');
my $config = $self->plugin('NotYAMLConfig');
$self->secrets($config->{secrets});
@ology
ology / .pl
Last active August 4, 2023 14:47
Benchmark any vs grep
#!/usr/bin/env perl
use strict;
use warnings;
use Benchmark;
use List::Util 'any';
my $count = shift || 10_000_000;
my $needle = 111;
@ology
ology / .pl
Created July 25, 2023 18:22
Perl map vs foreach
#!/usr/bin/env perl
use strict;
use warnings;
use Benchmark;
my $count = shift || 100_000_000;
timethese($count, {
map_it => \&map_it,
@ology
ology / .txt
Created July 16, 2023 14:12
FAIL Music-ModalFunction-0.0312 5.28.0 GNU/Linux
Report for Music-ModalFunction-0.0312
Back
From: Andreas J. König (ANDK)
Subject: FAIL Music-ModalFunction-0.0312 5.28.0 GNU/Linux
Date: 2023-07-12T06:01:26Z
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 cpan-testers-discuss@perl.org
@ology
ology / .db
Last active June 27, 2023 22:23
db->select(...) only returning one record?
sqlite> select * from moog_matriarch;
1|{"bottom":20,"control":"knob","group":"filter","is_default":1,"parameter":"cutoff","top":20000,"unit":"Hz","value":200}|Test setting!
2|{"bottom":0,"control":"patch","group":"modulation","is_default":1,"parameter":"wave out","top":1,"unit":"boolean","value":1}|Test setting!
@ology
ology / .db
Created June 27, 2023 06:44
Mojo::SQLite warning on insert, but it happens anyway?
sqlite> .schema
CREATE TABLE moog_matriarch (id integer primary key autoincrement, json text not null);
CREATE TABLE sqlite_sequence(name,seq);
sqlite> select * from moog_matriarch;
1|{"bottom":20,"control":"knob","group":"filter","is_default":0,"parameter":"cutoff","top":20000,"unit":"Hz","value":200}
@ology
ology / stacktrace.txt
Created June 16, 2023 18:30
Dancer + Mysql mystery - logs-in select people. Others - no dice.
...
Jun 15 21:33:53 chess uwsgi_psgi[179061]: [pid: 179061|app: 0|req: 1450/1450] 143.110.222.166 () {36 vars in 512 bytes} [Thu Jun 15 21:33:53 2023] GET / => generated 0 bytes
in 12 msecs (HTTP/1.1 302) 6 headers in 293 bytes (0 switches on core 0)
Jun 15 21:37:39 chess uwsgi_psgi[179061]: [pid: 179061|app: 0|req: 1451/1451] 216.244.66.245 () {36 vars in 515 bytes} [Thu Jun 15 21:37:39 2023] GET /robots.txt => generated
26 bytes in 5 msecs via sendfile() (HTTP/1.1 200) 3 headers in 111 bytes (0 switches on core 0)
Jun 15 21:42:19 chess uwsgi_psgi[179061]: _ANON__('HASH(0x555a86dd4580)') called at /home/gene/repos/Family-Site/bin/app.pl line 0
Jun 15 21:42:19 chess uwsgi_psgi[179061]: eval {...} at /home/gene/repos/Family-Site/bin/app.pl line 0
Jun 15 21:42:19 chess uwsgi_psgi[179061]: Trace begun at (eval 342) line 1
Jun 15 21:42:19 chess uwsgi_psgi[179061]: main::__ANON__('DBIx::Class::Exception=HASH(0x555a86ddb910)') called at /usr/local/share/perl/5.30.0/DBIx/Class/Exception.pm line 77
Jun 15 21:42:19
@ology
ology / build.log
Last active June 12, 2023 17:54
IO::Async fails to install on my macOS Monterey 12.6 :\
cpanm (App::cpanminus) 1.7044 on perl 5.034000 built for darwin-2level
Work directory is /Users/geneboggs/.cpanm/work/1686591626.77409
You have make /usr/bin/make
You have LWP 6.59
You have /usr/bin/tar: bsdtar 3.5.1 - libarchive 3.5.1 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.8
You have /usr/bin/unzip
Searching IO::Async () on cpanmetadb ...
--> Working on IO::Async
Fetching https://cpan.metacpan.org/authors/id/P/PE/PEVANS/IO-Async-0.802.tar.gz
-> OK