Skip to content

Instantly share code, notes, and snippets.

View manwar's full-sized avatar
✌️
Undercover Contributor

Mohammad Sajid Anwar manwar

✌️
Undercover Contributor
View GitHub Profile
#!/usr/bin/perl
use strict;
use warnings;
use 5.024;
package SVG::TrafficLight;
use Moose;
use SVG;
@Ovid
Ovid / date.pl
Created August 27, 2019 13:45
Partial desription of a date matching regex
#!/usr/bin/env perl
use Test::Most;
use Veure::Script; # strict, warnings, postderef, sigs, and more
use re 'eval'; # needed for (??{}) in the regex
# the (??{}) construct will execute code and consider the result of that
# to be a regex to match on.
my $yyyy_mm_dd = qr/
^
# any four digit year
perl -MJSON::PP -E 'foreach ("001".."031") {$c = `curl -s "https://perlweeklychallenge.org/chart/pwc-challenge-$_.json"`; $d = decode_json $c; say scalar @{$d->{series}->[0]->{data}}; }' | perl -nalE 'push @d, $_ }{ say sprintf "https://quickchart.io/chart?width=500&height=300&c={type:\"bar\",data:{labels:[%s],datasets:[{label:\"Perl Weekly Challenge users by week\",data:[%s]}]}}", join(",", 1..scalar(@d)), join(",", @d)'