create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
package ExceptionTestController; | |
use Mojo::Base 'Mojolicious::Controller'; | |
use Data::Validator::Results::Any; | |
sub raise_known_exception { | |
my $self = shift; | |
return unless $self->rest_eval( | |
sub { |
# is_within_ascii | |
# | |
# Returns a copy of the string if it is within ascii. If it is outside of the | |
# range, it will raise an error. | |
sub is_within_ascii { | |
my $string = shift; | |
# look for anything that isn't ascii or pass | |
$string =~ /([^\x{00}-\x{7f}])/ or return $string; |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
#!/usr/bin/env perl | |
use Modern::Perl; | |
use DBI; | |
use DBD::Pg qw(:async); | |
use Coro; | |
use AnyEvent; | |
use Time::HiRes qw(time); |
=head2 get_date_range $start, $end | |
Returns a list of dates from the range in YYYY-MM-DD format. | |
$start and $end must also be in the same format. This is assumed and will break | |
if the format is anything other than that. | |
my $now = DateTime->now()->ymd; | |
my $last_month = DateTime->now()->subtract( days => 51 )->ymd; | |
my $date_range = get_date_range($last_month, $now, 1); |
#!/usr/bin/env perl | |
use Mojolicious::Lite; | |
plugin 'OAuth2', | |
google => { | |
key => $ENV{GOOGLE_OAUTH2_CLIENT_ID}, | |
secret => $ENV{GOOGLE_OAUTH2_CLIENT_SECRET}, | |
}; | |
my $service = 'https://www.googleapis.com'; |
#!/usr/bin/env perl | |
use Mojo::Base -strict; | |
use Mojo::UserAgent; | |
die "Usage: $0 http://api.github.com/v1/connected /users[=10] [API_NAME]\n" | |
unless scalar @ARGV >= 2; | |
my $url = shift; | |
my $path = shift; |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
#!/usr/bin/env perl | |
use EV; | |
use AnyEvent::IRC::Client; | |
use Mojolicious::Lite; | |
app->config(hypnotoad => {listen => ['http://*:3000']}); | |
# Join #mojo on irc.perl.org | |
my $irc = AnyEvent::IRC::Client->new; | |
$irc->connect('172.16.0.34', 6667, {nick => "mojobot$$"}); |