This file contains hidden or 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
| use Mojo::Base -strict; | |
| use Mojo::ByteStream 'b'; | |
| use Mojo::Collection; | |
| use Mojo::CSV; | |
| use Mojo::Util qw(dumper sha1_sum); | |
| use Time::Piece; | |
| my ($SEED, $COUNTER) = ($$ . time . rand, int rand 0xffffff); |
This file contains hidden or 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
| package Mojo::UserAgent::Role::AWSSignature4; | |
| use Mojo::Base -role, -signatures; | |
| use Digest::SHA; | |
| use Mojo::Collection; | |
| use Time::Piece; | |
| has access_key => sub { $ENV{AWS_ACCESS_KEY} or die 'missing "access_key"' }; | |
| has aws_algorithm => 'AWS4-HMAC-SHA256'; | |
| has content => undef; |
This file contains hidden or 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
| use Mojo::Base -strict; | |
| use Mojo::Util 'dumper'; | |
| use Mojo::File 'path'; | |
| use Mojo::ByteStream 'b'; | |
| my ($at, $qb) = map { b(path($_)->slurp)->split("\n") } @ARGV[0,1]; | |
| my %recon; | |
| $at->grep(qr/^\d+\t/)->each(sub { |
This file contains hidden or 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
| package Mojolicious::Command::router; | |
| use Mojo::Base 'Mojolicious::Command'; | |
| use Mojo::Log; | |
| use Mojo::UserAgent; | |
| use Mojo::Server::Prefork; | |
| use Mojo::File 'path'; | |
| use Mojo::Util qw'dumper getopt'; | |
| use Mojo::Collection 'c'; | |
| use Mojo::ByteStream 'b'; |
This file contains hidden or 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
| use ojo; | |
| no warnings; | |
| my $j = j(<>); | |
| my %c = (); | |
| $c{$_}++ foreach map { keys %$_ } @$j; | |
| my @c = sort keys %c; | |
| say join "\t", @c; | |
| say join "\t", @$_{@c} foreach @$j; |
This file contains hidden or 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
| use Mojo::Base -strict; | |
| use Mojo::File 'path'; | |
| use Mojo::JSON 'j'; | |
| use Mojo::UserAgent; | |
| use Mojo::URL; | |
| # Usage: | |
| # HUBSPOT_HAPIKEY=8....d HUBSPOT_USERID=3....0 perl export 3 2 1 | |
| our $base = 'https://api.hubapi.com'; |
This file contains hidden or 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
| my $dry = 1; | |
| # Remove query string from files on disk | |
| $home->list_tree->slice(0)->each(sub{ | |
| /^(.*?)\?|\@/ or return; | |
| say "$_ => $1"; | |
| return if $dry; | |
| $_->move_to($1); | |
| }); |
This file contains hidden or 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
| use Mojo::Base -strict; | |
| use Mojo::Util 'dumper'; | |
| use Algorithm::Diff 'sdiff'; | |
| my @a = split //, 'acaagaaaagagacgaaagacacaggggcgccgagggcagaagaaagagcaacgacggcccacaaaagcgggaacgccag'; | |
| my @b = split //, 'acaagaaaagatatgaaagacacaggggcgccgagggcagaagaagcaacgacggcccacaaaagcgggaggctgaaacgccag'; | |
| my @sdiff = sdiff(\@a, \@b); | |
| say join '', map { $_->[1] || ' ' } @sdiff; |
This file contains hidden or 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 lib 'lib'; | |
| use lib 'Mojocron/lib'; | |
| use Mojo::Log; | |
| use Mojo::HelloWorld; | |
| use Mojo::IOLoop; | |
| use Mojo::Server::Daemon; | |
| use Mojo::Server::Morbo; |