Skip to content

Instantly share code, notes, and snippets.

@msouth
msouth / Reproduce.pm
Created June 11, 2013 15:59
dancer -a Minimal::Reproduce; edit the .pm file to look like this; perl Makefile.PL; make; make test; fails because simple_crud() tries to connect to database and doesn't know how
package Minimal::Reproduce;
use Dancer ':syntax';
use Dancer::Plugin::SimpleCRUD;
our $VERSION = '0.1';
get '/' => sub {
template 'index';
};
@msouth
msouth / doesn't work
Created April 20, 2013 18:23
incorrect fix [edit: maybe it is correct after all] for problem with new auth stuff in D::P::SimpleCRUD
--- a/lib/Dancer/Plugin/SimpleCRUD.pm
+++ b/lib/Dancer/Plugin/SimpleCRUD.pm
@@ -1176,6 +1193,8 @@ sub _ensure_auth {
Dancer::ModuleLoader->load('Dancer::Plugin::Auth::Extensible')
or die "Can't use auth settings without"
. " Dancer::Plugin::Auth::Extensible!";
+ } else {
+ return $handler;
}
@msouth
msouth / gist:5423491
Created April 19, 2013 21:53
When will a calendar for the current year be usable again?
perl -e 'for $year (2013..2113) {$cal = qx{cal $year}; $cal =~ s/\d{4}//; if ($year eq "2013") {$comp_cal = $cal} else { die "cal $year\n" if $comp_cal eq $cal} }'
cal 2019
use Dancer;
use MyTop::MyMiddle::MeetingAlerts;
use Plack::Builder;
my $app = sub {
my $env = shift;
my $request = Dancer::Request->new(env=>$env);
Dancer->dance($request);
};
@msouth
msouth / gist:5029672
Created February 25, 2013 13:00
Lines in Dancer cookbook that look unnecessary to me
# bin/script2.pl
#unnecessary use FindBin;
#unnecessary use Cwd qw/realpath/;
use Dancer ':script';
=pod
Dancer already knows this
#tell the Dancer where the app lives