Skip to content

Instantly share code, notes, and snippets.

View ology's full-sized avatar
💭
🤔

Gene Boggs ology

💭
🤔
View GitHub Profile
@ology
ology / .txt
Created October 21, 2023 20:09
marimba-madness mystery ?
▸ perl marimba-madness.pl
2023-10-21 13:08:18 geneboggs@mac-geneboggs:~/sandbox/Perl/music
▸ timidity -Od out.midi
Can't estimate audio queue length
Playing out.midi
MIDI file: out.midi
Format: 1 Tracks: 6 Divisions: 96
Sequence: Track 001 1697918898
Track name: Track 002 1697918898
Marker: silence
@ology
ology / gpt4.pl
Last active October 16, 2023 00:09
Hey GPT4, why does God allow mosquitoes to live?
>> The question of why God allows mosquitoes to live is a theological and philosophical one, and it depends on one's beliefs and interpretations. There are several possible explanations that people have put forth:
1. Balance in nature: Some argue that mosquitoes play a role in the ecosystem, serving as a food source for other animals and contributing to the overall balance of nature. Their presence may be necessary for maintaining the ecological system.
2. Free will and natural processes: In many religious beliefs, God has given humans and other creatures free will and allows natural processes to occur. This means that mosquitoes, like other organisms, have the freedom to exist and fulfill their purpose, even if it causes inconvenience or harm to humans.
3. Testing and growth: Some believe that God allows mosquitoes to exist as a way to test humans and help them grow in character. Dealing with challenges, discomfort, or annoyance caused by mosquitoes can contribute to personal growth, patience, or empathy.
@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 [email protected]
@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}