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 | |
| ## This script expects to find the following files in the folder 'public' in the current directory | |
| # jquery-1.7.2.min.js | |
| # bootstrap.min.js | |
| # bootstrap.min.css | |
| # jquery.flot.min.js | |
| # codemirror.js # 2.32 | |
| # codemirror.css | |
| # perl.js # codemirror mode |
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 strict; | |
| use warnings; | |
| package PDL; | |
| use overload '&{}' => sub { | |
| my $pdl = shift; | |
| my $slice = $pdl->can('slice'); | |
| return sub { unshift @_, $pdl; goto $slice }; |
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
| \documentclass{article} | |
| \usepackage{pgf} | |
| \begin{document} | |
| \pgfmathparse{int(1+1)} | |
| The result of $ 1 + 1 $ is \pgfmathresult. | |
| Read more in the \verb!pgfmaual! (type \verb!texdoc pgfmanual!). |
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 strict; | |
| use warnings; | |
| use 5.010; | |
| use Mojo::DOM; | |
| use HTML::TreeBuilder; | |
| my $content = <<'EOF'; | |
| <html> | |
| <body> |
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 strict; | |
| use warnings; | |
| use Mojo::Template; | |
| my $mt = Mojo::Template->new( | |
| comment_mark => '%', | |
| line_start => '@', |
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 Mojolicious::Lite; | |
| # connect to database | |
| use DBI; | |
| my $dbh = DBI->connect("dbi:SQLite:database.db","","") or die "Could not connect"; | |
| # shortcut for use in template | |
| helper db => sub { $dbh }; |
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::Plugin::EPRenderer; | |
| use Mojo::Base 'Mojolicious::Plugin'; | |
| use Mojo::Template; | |
| use Mojo::Util qw(encode md5_sum); | |
| use Scalar::Util (); | |
| sub register { | |
| my ($self, $app, $conf) = @_; |
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 strict; | |
| use warnings; | |
| use v5.10; | |
| use Mojo::DOM; | |
| my $dom = Mojo::DOM->new( <<'HTML' ); | |
| <div class="txt-block"> | |
| <h4 class="inline">Opening Weekend:</h4> |
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 strict; | |
| use warnings; | |
| use v5.10; | |
| use Mojo::DOM; | |
| my $dom = Mojo::DOM->new( <<'HTML' ); | |
| <table border="0" cellpadding="2"> | |
| <tbody><tr><th class="xxxx">Country</th><th class="xxxx">Date</th></tr> |
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 strict; | |
| use warnings; | |
| use v5.10; | |
| { | |
| package Webservice::CTA; | |
| use Mojo::Base -base; |