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
315 # And a route to list records already in the table: | |
316 get "$args{prefix}" => sub { | |
317 # TODO: handle pagination | |
318 my $sth = $dbh->prepare("select * from $table_name"); | |
319 $sth->execute; | |
320 my $table = HTML::Table::FromDatabase->new( | |
321 -sth => $sth, | |
322 -border => 1, | |
323 ); | |
324 return $table->getTable; |
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
my $matches; | |
while ($html =~ m{ | |
<optgroup \s+ label=" | |
(?<label> .+?) | |
"> | |
(?<options_html> .+?) | |
</optgroup> | |
}gxsi) | |
{ | |
say "Group: [$+{label}]"; |
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
simple_crud( | |
prefix => 'test', | |
db_table => 'test', | |
record_title => 'Test Thing', | |
); |
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/perl | |
use strict; | |
use Dancer; | |
set logger => 'console'; | |
set log => 'debug'; | |
before sub { | |
debug("In before filter"); |
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
DB<1> $foo = 'Foo'; | |
DB<2> x ref $foo; | |
0 '' | |
DB<3> $foo->{bar} = 'Bar'; | |
DB<4> x ref $foo; | |
0 '' | |
DB<5> x $foo; | |
0 'Foo' |
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
[davidp@shakermaker:~]$ cat /etc/init.d/site-ijedomestics | |
#! /bin/sh | |
# Simple script for starting Dancer applications. | |
SITENAME=ijedomestics | |
PORT=5000 | |
DIR=/websites/ijedomestics | |
SCRIPT=ijedomestics.pl | |
USER=davidp |
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/perl | |
use Dancer; | |
set template => 'template_toolkit'; | |
get '/' => sub { | |
return template 'index', { foo => [ qw(one two three four) ] }; | |
}; | |
dance; |
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
[davidp@supernova:~/tmp/php-csv-test]$ php php-csv-test.php | |
array ( | |
0 => | |
array ( | |
'name' => 'David Precious', | |
'age' => '29', | |
'comment' => 'rocks', | |
), | |
) |
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
plugins: | |
Database: | |
driver: pg | |
... | |
dbi_params: | |
pg_enable_utf8: 1 | |