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 FindBin; | |
use lib $FindBin::Bin; | |
my %u; | |
opendir(my $DP, '.') or die $!; | |
while (my $p = readdir $DP) { |
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 Mojo::JSON::Patch; | |
use Mojo::Base 'Mojo::JSON::Pointer'; | |
use Carp 'croak'; | |
use Mojo::Path; | |
sub set { | |
my $self = shift; | |
my $path = Mojo::Path->new(shift); | |
my $val = 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
diff --git a/lib/Mojo/JWT.pm b/lib/Mojo/JWT.pm | |
index 11fdb2b..0281ff1 100644 | |
--- a/lib/Mojo/JWT.pm | |
+++ b/lib/Mojo/JWT.pm | |
@@ -5,6 +5,9 @@ use Mojo::Base -base; | |
our $VERSION = '0.05'; | |
$VERSION = eval $VERSION; | |
+our @EXPORT_OK = qw/decode_jwt encode_jwt/; | |
+ |
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
label.checkbox, | |
label.radio { | |
cursor: pointer; | |
position: relative; | |
} | |
label.checkbox input + span, | |
label.radio input + span { | |
margin-left: 1.6rem; | |
} |
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 ClassMeta; | |
use Mojo::Base -strict; | |
use Hook::AfterRuntime; | |
use B::Hooks::EndOfScope; | |
sub import { | |
my $class = shift; | |
my $caller = caller; | |
my %meta = (ATTRS => {}, METHODS => {}); | |
my %ignore; |
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
(function(w) { | |
/* | |
* Allow multiple clients share the same connection, but send/receive data on a topic they want | |
* | |
* var ws = WebSocketChannel("wss://example.com/mux", "testTopic"); | |
* var ws = WebSocketChannel("wss://example.com/mux", {topic: "..", protocols: ...}); | |
* var ws = WebSocketChannel({url: "wss://example.com/mux", topic: "..", protocols: ...}); | |
* ws.onopen = function(e) { this.send({some: data}) }; | |
*/ | |
w.WebSocketChannel = function(url, params) { |
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
#!perl | |
use Mojolicious::Lite; | |
get '/' => sub { | |
my $c = shift; | |
my $ua = Mojo::UserAgent->new; | |
# Try keeping this object alive with http://localhost:3000?keep_alive=1 | |
$c->stash(ua => $ua) if $c->param('keep_alive'); |
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; | |
my $dir = ($ARGV[0] and -d $ARGV[0]) ? shift @ARGV : '.'; | |
my @ymd = (shift @ARGV); | |
my @today = (localtime)[5, 4]; # (year, mon) | |
$today[0] += 1900 if $today[0] <= 1900; | |
$today[1]++; |
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
#content { | |
border: 0; | |
padding: 40px 50px 30px 350px; | |
margin: 0; | |
} | |
#mw-page-base { | |
display: none; | |
} |
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
h2, | |
h3 { | |
text-transform: uppercase; | |
} | |
.site { | |
letter-spacing: 0.1em; | |
line-height: 1.6rem; | |
text-transform: none; | |
max-width: 100% !important; |