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 Benchmark; | |
use CBOR::XS (); | |
use Cpanel::JSON::XS (); | |
use Data::MessagePack; | |
use JSON::XS (); | |
use Sereal::Encoder; | |
use Sereal::Decoder; |
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
import std.stdio; | |
import std.bigint; | |
import core.checkedint; | |
void main() { | |
writefln("%d", fib_iter(72)); | |
writefln("%d", fib_binet(72)); | |
} | |
auto fib_iter (int n) { |
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 strict; | |
use warnings; | |
use DBI; | |
use Data::Dumper; | |
use Geohash; | |
use Text::CSV; |
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 strict; | |
use warnings; | |
if (@ARGV < 1) { | |
print "usage: $0 <file>\n"; | |
exit 0; | |
}; |
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 strict; | |
use warnings; | |
use Data::Dumper; | |
use Mojo::URL; | |
use Mojo::UserAgent; | |
my $ua = Mojo::UserAgent->new->max_redirects(3); |
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/sh | |
alias rm='rm -i' | |
alias mv='mv -i' | |
alias cp='cp -i | |
alias plack-app-dir="plackup -MPlack::App::Directory -e 'my \$app = Plack::App::Directory->new({ root => \"\$ENV{HOME}/public\" })->to_app;'" |
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::IOLoop; | |
use POSIX; | |
# Start at sec % 5 == 0 | |
Mojo::IOLoop->timer((5 - (localtime)[0] % 5) => sub { | |
# Perform operation every 5 seconds | |
Mojo::IOLoop->recurring(5 => sub { | |
my $loop = shift; |
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 strict; | |
use warnings; | |
use Child; | |
use Data::Dumper; | |
use Sereal::Encoder; | |
use Sereal::Decoder; |
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/end perl | |
use strict; | |
use warnings; | |
use Data::Dumper; | |
my $hist = sub { | |
my $input = shift; | |
if ($input and $input =~ /^\d+$/) { |
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 | |
# | |
# Time::Piece and Class::Date benchmarked | |
# | |
use strict; | |
use warnings; | |
use Benchmark qw(cmpthese); | |
use Time::Piece; |