Skip to content

Instantly share code, notes, and snippets.

@brianmed
brianmed / slide1.pl
Last active December 14, 2015 18:29
#!/opt/perl
use Mojolicious::Lite;
get '/' => sub {
my $self = shift;
$self->render("slash");
};
@brianmed
brianmed / slide3.pl
Last active December 14, 2015 18:29
#!/opt/perl
use Mojolicious::Lite;
get '/' => sub {
my $self = shift;
$self->render("slash");
};
@brianmed
brianmed / slide2.pl
Last active December 14, 2015 18:29
#!/opt/perl
use Mojolicious::Lite;
get '/' => sub {
my $self = shift;
$self->render("slash");
};
@brianmed
brianmed / slide4.pl
Last active December 14, 2015 18:29
#!/opt/perl
use Mojolicious::Lite;
get '/' => sub {
my $self = shift;
$self->app->log->debug("get");
$self->render("slash");
@brianmed
brianmed / gist:5747787
Created June 10, 2013 10:27
Methodology for starting and stopping worker processes when hypnotoad stops and starts.
use strict;
use warnings;
# $DB::deep = 500;
use FindBin;
BEGIN { unshift @INC, "$FindBin::Bin/../lib" }
# $DB::single = 1;
InfoServant::Start->start_app('InfoServant');
#!/opt/perl
use Mojolicious::Lite;
plugin 'tt_renderer';
app->renderer->default_handler('tt');
sub eval_me {
my $route = shift;
my $sub = shift;
@brianmed
brianmed / infoservant.com.conf
Created June 16, 2013 23:23
Mojolicious deployment with Apache, VirtualHosts, mod_perl, and Plack
<VirtualHost *:80>
ServerName infoservant.com
ServerAlias www.infoservant.com
ErrorLog logs/infoservant.com-error_log
CustomLog logs/infoservant.com-access_log combined
DocumentRoot /opt/infoservant.com/docroot
<Location />
#!/opt/perl
use Mojolicious::Lite;
get '/' => sub {
my $self = shift;
die("Here") if $self->param("exception");
$self->render("slash");
#!/opt/perl
use Mojolicious::Lite;
get '/' => sub {
my $self = shift;
die("Here") if $self->param("exception");
$self->render("slash");
@brianmed
brianmed / programmatic_redirect.pl
Created July 1, 2013 19:35
Programmatically redirect
#!/opt/perl
use Mojolicious::Lite;
# Documentation browser under "/perldoc"
plugin 'PODRenderer';
get '/' => sub {
my $self = shift;
$self->render('index');
};