Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env perl
use Mojo::Base -base;
use IPC::System::Simple qw/capture/;
use FindBin qw/$Bin/;
use Data::Dumper;
use JSON::MaybeXS;
use Path::Tiny;
chdir $Bin;
my $j = JSON->new->pretty->canonical;
# Before:
my %thing = ( this => 'that', other => $self->my_method(@args));
sub my_method { ...; return $stuff }
# except it's really easy for me the developer to forget to type the 'other' key
# which results in surprising fails
# So ... wantarray
@dr-kd
dr-kd / Dockerfile
Created October 4, 2022 23:21
postgres oracle fdw container
ARG postgres_version=15beta4
FROM postgres:$postgres_version
ARG oracle_fdw_version=2_4_0
ENV ORACLE_HOME /usr/lib/oracle/19.6/client64
ENV LD_LIBRARY_PATH /usr/lib/oracle/19.6/client64/lib
RUN set -ex; \
@dr-kd
dr-kd / audio-with-speed-control.markdown
Created September 25, 2022 08:44
Audio with speed control
#!/bin/bash
# script to update your header cache for imap folders of interest non-interactively.
# set this up to run nightly in cron - it especially helps the performance of BIG mail boxes
# e.g. mailboxes big enough to crash outlook are super-snappy after header cache refresh
declare -a FOLDERS=("Archive"
"Drafts"
"INBOX"
"Outbox"
"Sent\ Items"
"Tasks"
#!/usr/bin/env perl
use warnings;
use strict;
use Array::Circular;
use Data::Dumper;
use Text::Xslate qw/mark_raw/;
use feature qw/say/;
my $tx = Text::Xslate->new(syntax => 'TTerse');
#!/usr/bin/env perl
use warnings;
use strict;
use Array::Circular;
use Data::Dumper;
use Text::Xslate qw/mark_raw/;
use feature qw/say/;
my $tx = Text::Xslate->new(syntax => 'TTerse');
#include <Keypad.h>
const byte ROWS = 7;
const byte COLS = 5;
byte CHANNEL = 1;
char keys[COLS][ROWS] = {
{ 31, 32, 30, 10, 2, 28, 29 },
{ 27, 7, 9, 25, 26, 24, 4 },
{ 6, 22, 23, 21, 1, 3, 19 },
@dr-kd
dr-kd / Proposal.POD
Created October 8, 2017 11:44 — forked from jjn1056/Proposal.POD
First Draft of possible grant proposal (2nd Draft)

Perl Catalyst Web Framework for Heretics.

Name:

John Napiorkowski <jjnapiork@cpan.org>,<jjn1056@gmail.com>

Amount Requested:

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

Around line 4:

=over without closing =back

#!/usr/bin/env perl;
use warnings;
use strict;
use IPC::System::Simple qw/capture/;
use DateTime;
my $now = DateTime->now;
my $st = '/usr/local/bin/speedtest-cli'; # via pip-install speedtest-cli
my $res = capture "$st";
my ($ping) = $res =~ /(\d+\.\d+) ms/ms;
my ($download) = $res =~ /Download: (\d+\.\d+) /ms;