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 | |
package A; | |
use Mojo::Base -base; | |
use 5.020; | |
use feature qw(signatures); | |
has [qw(a b)]; | |
sub new { |
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
package Cat; | |
use Mojo::Base -base; | |
has name => 'Nyan'; | |
has ['age', 'weight'] => 4; | |
package Tiger; | |
use Mojo::Base 'Cat'; | |
has friend => sub { Cat->new }; |
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
Needs some error handling. | |
release () | |
{ | |
NAME=$(perl -p -E '$_ = /^\s*NAME\s*/ ? eval("{$_}")->{NAME} : undef' Makefile.PL); | |
VERSION_FROM=$(perl -p -E '$_ = /^\s*VERSION_FROM\s*/ ? eval("{$_}")->{VERSION_FROM} : undef' Makefile.PL); | |
CV=$(perl -E "require '$VERSION_FROM'; say \$$NAME::VERSION"); | |
BV=$(perl -E "require '$VERSION_FROM'; say \$$NAME::VERSION+0.01"); | |
rm -f Mojolicious-Plugin-MimeTypes-*.tar.gz; | |
git tag $CV; |
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 Mojolicious::Lite; | |
use Mango; | |
use Mojo::IOLoop; | |
use DDP; | |
use feature 'current_sub'; | |
plugin 'Config' => { | |
file => 'leaderboard.conf', |
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
#!/opt/perl | |
use Mojolicious::Lite; | |
use JSON; | |
get '/' => sub { | |
my $self = shift; | |
$self->render("index"); | |
}; |
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
/* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. | |
*/ | |
#include <arpa/inet.h> | |
#include <linux/if_packet.h> | |
#include <stdio.h> |