A Pen by Christian Heilmann on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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; |
NewerOlder