Skip to content

Instantly share code, notes, and snippets.

@Grinnz
Grinnz / service_squatters.txt
Last active June 9, 2021 16:44
Freenode services outage
WHOWAS response for chanserv
Nick Usermask Real name Last connected Connected via
chanserv sorcerer@<ip removed> sorcerer Wed Jun 9 15:56:22 2021 ace.freenode.net
chanserv sorcerer@<ip removed> sorcerer Wed Jun 9 15:55:52 2021 ace.freenode.net
chanserv sorcerer@<ip removed> sorcerer Wed Jun 9 15:48:16 2021 ace.freenode.net
ChanServ ~hrnz@<ip removed> hrnz Wed Jun 9 15:46:21 2021 niveus.freenode.net
ChanServ ~hrnz@irc.plumbing hrnz Wed Jun 9 15:44:03 2021 niveus.freenode.net
ChanServ ChanServ@services. Channel Services Wed Jun 9 15:28:18 2021 services.
WHOWAS response for nickserv
@Grinnz
Grinnz / channel_flags_2021-05-22.txt
Last active May 26, 2021 03:22
Freenode hostile takeover of #perl
14:04:12 <ChanServ> Entry Nickname/Host Flags
14:04:12 <ChanServ> ----- ---------------------- -----
14:04:12 <ChanServ> 1 BinGOs +Aiotv [modified ? ago]
14:04:12 <ChanServ> 2 tag +Aiotv [modified ? ago]
14:04:12 <ChanServ> 3 simcop2387 +Aiostv [modified 2y 28w 3d ago]
14:04:12 <ChanServ> 4 tybalt89 +Aiotv [modified ? ago]
14:04:12 <ChanServ> 5 kitchen +AReiorstv [modified ? ago]
14:04:12 <ChanServ> 6 Paladin +AReiorstv [modified ? ago]
14:04:12 <ChanServ> 7 integral +Aiotv [modified ? ago]
14:04:12 <ChanServ> 8 dngor +Aiotv [modified ? ago]
@Grinnz
Grinnz / perl7faq.md
Last active October 27, 2024 15:59
Perl 7 FAQ

Perl 7 FAQ

last updated 2022-05-26

Is Perl 7 coming?

It is the current plan that this version number will be used for Perl at some point in the future.

When is Perl 7 coming?

@Grinnz
Grinnz / nil.t
Created August 26, 2020 16:29
Protocol::Redis::XS nil tests
use strict;
use warnings;
use Test::More;
use Protocol::Redis::XS;
my $redis = new_ok 'Protocol::Redis::XS', [api => 1];
$redis->parse("\$-1\r\n");
is $redis->get_message->{data}, undef, "nil bulk message";
@Grinnz
Grinnz / mapping_colors.md
Last active November 17, 2020 04:38
Drum Charting: Mapping Colors

Mapping Colors in Drum Charting

For simple drum parts that involve at most a snare, three toms, and three cymbals, it's easy to map them to colors in 4-lane drums.

  • Red: Snare
  • Yellow: High rack tom, hihat
  • Blue: Low rack tom, ride
  • Green: Floor tom, crash

But few drummers outside of pop and jazz keep their kits so limited. So you have to work whatever the drummer may use into the lanes you have. We start with the base mapping above to keep things familiar, and deviate when needed.

@Grinnz
Grinnz / protocol.t
Last active February 8, 2019 22:23
Mojo::Redis::Protocol test file
use Mojo::Base -strict;
use Test::More;
use Mojo::Redis::Protocol;
my $protocol = Mojo::Redis::Protocol->new;
# Protocol error
ok !eval { $protocol->parse("\@") }, 'protocol error';
like $@, qr/Unknown message type/, 'right error';
is_deeply [$protocol->parse('')], [], 'state not reset';
package Perl::Critic::Policy::VariableNameReuse;
use strict;
use warnings;
use Perl::Critic::Utils qw(:severities :classification :ppi);
use parent 'Perl::Critic::Policy';
use constant EXPL => 'Using the same name for multiple types of variables can be confusing, e.g. %foo and $foo. Use different names for different variables.';
@Grinnz
Grinnz / gist:bb31cdff63006c856aead3e3311d0c13
Created November 2, 2018 22:45
mojo streaming file upload
use strict;
use warnings;
use Mojo::UserAgent;
use Mojo::Asset::File;
# Build a normal transaction
my $ua = Mojo::UserAgent->new;
my $tx = $ua->build_tx(POST => 'http://example.com');
# Prepare body
> mojo get 'http://localhost:3000//fred/fish'
[Tue Feb 20 16:28:38 2018] [debug] GET "/fish"
[Tue Feb 20 16:28:38 2018] [debug] Routing to a callback
[Tue Feb 20 16:28:38 2018] [debug] 200 OK (0.000438s, 2283.105/s)
fred⏎
@Grinnz
Grinnz / perlbug_each.txt
Created December 20, 2017 19:23
perlbugs
The 'each' function documentation is missing some information.
1. When called in scalar context in a while loop, the condition is wrapped
implicitly in a 'defined' check, much like with 'readline'.
e.g. `while (my $key = each %hash) { ... }` becomes
`while (defined(my $key = each %hash)) { ... }`, and
`while (each %hash) { ... }` becomes `while (defined($_ = each %hash)) { ... }`
(on 5.18+)