Skip to content

Instantly share code, notes, and snippets.

@hdp
hdp / 00-incoming
Created April 23, 2009 02:35
hdp's free software todo list
We couldn’t find that file to show.
controller User {
# /user/\d+/...
chained action user (Int $id) { ... load a user ... }
under user {
# GET /user/\d+
action view at / on GET { ... render a user ... }
# PUT /user/\d+
action update at / on PUT { ... update the user ... }
# DELETE /user/\d+

Moose Hackathon Agenda

  • Traits in C::MOP
  • removing T::E from Moose/MOP
    • adding lives_ok/dies_ok to Test::Moose
  • merging C::MOP and Moose
  • Antlers
  • merging MooseX modules into Moose and/or core
    • MX::AH into core
  • MooseX::Traits -> Moose::Traits
package Class;
use Moose;
use Moose::Util::TypeConstraints;
## Whatever, you get the idea.
sub trim_whitespace { my $str = shift; $str =~ s/^\s+|\s+$//; $str };
sub boolify { my $str = shift; $str =~ /^y/i ? 1 : $str };
## Guess i need to say an OLBool is just a regular bool that coerces, stringifies, and removes padding... JOYZER. Shouldn't the where be at the very least, inherited it is a subtype.
# vim: ft=perl:
use strict;
use warnings;
use Plack::Builder;
use Plack::App::WrapCGI;
use Plack::App::URLMap;
builder {
enable 'Static',
sub env_filter (&) {
my $code = shift;
sub {
my $app = shift;
sub {
my $env = shift;
$code->($env);
return $app->($env);
};
}
#!perl
use strict;
use warnings;
use Reflex::POE::Wheel::Run;
my $log = IO::File->new('log', 'w') or die $!;
my %w;
t/Plack-Handler/fcgi.t ......................... 1/? # Testing with lighttpd 1.4.19
t/Plack-Handler/fcgi.t ......................... 87/?
# Failed test at /home/hdp/perl5/perlbrew/perls/perl-5.10.1/lib/5.10.1/Test/More.pm line 372.
# got: ''
# expected: '/fastcgi'
t/Plack-Handler/fcgi.t ......................... 109/?
# Failed test at /home/hdp/perl5/perlbrew/perls/perl-5.10.1/lib/5.10.1/Test/More.pm line 372.
# got: 'REQUEST_METHOD:GET
# PATH_INFO:/fastcgi/foo/
# QUERY_STRING:dankogai=kogaidan
use Plack::App::Cascade;
my $app = Plack::App::Cascade->new;
$app->add(sub {
my $env = shift;
return sub {
my $respond = shift;
my $writer = $respond->([404, []]);
$writer->write("boo");
$writer->close;
$app = ...;
if (my $map = $self->config->proxy_map) {
my $urlmap = Plack::App::URLMap->new;
for my $type (keys %$map) {
my ($prefix, $remote, $headers) =
@{$map->{$type}}{qw(path_prefix remote headers)};
$headers ||= {};
my $proxy = Plack::App::Proxy->new(
remote => $remote,
preserve_host_header => 1,