Skip to content

Instantly share code, notes, and snippets.

View typester's full-sized avatar
😇

Daisuke Murase typester

😇
View GitHub Profile
use strict;
use warnings;
use Test::More tests => 1;
use Text::MicroTemplate qw(:all);
is render_mt(<<'...')->as_string, "abc\n1\n2\n3\ndef\n";
abc
? if (1) {
? for my $n (1..3) {
?= $n
From bf13f9edbe14e68f7b8037ee8c0156a9e1afdbb5 Mon Sep 17 00:00:00 2001
From: Daisuke Murase <typester@cpan.org>
Date: Tue, 30 Jun 2009 16:14:13 +0900
Subject: [PATCH] fixed duplicate around attribute
---
lib/Ark/Plugin/Session/State/URI.pm | 15 +++++++--------
lib/Ark/Plugin/Session/State/URI/ExtendContext.pm | 15 +++++++++++++++
2 files changed, 22 insertions(+), 8 deletions(-)
create mode 100644 lib/Ark/Plugin/Session/State/URI/ExtendContext.pm
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<link rel="stylesheet" href="style.css" />
<title><? block title => sub { ?>My amazing site<? } ?></title>
</head>
<body>
<div id="sidebar">
From 55f57d7c4cf95547e6a0e3093155aa721dffae42 Mon Sep 17 00:00:00 2001
From: Daisuke Murase <typester@cpan.org>
Date: Tue, 9 Jun 2009 00:22:39 +0900
Subject: [PATCH] convert sample script to test
---
t/01_module.t | 175 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 175 insertions(+), 0 deletions(-)
create mode 100644 t/01_module.t
$HTTP["url"] !~ "^/(?:(?:css|js|img|images?|statis|tmp)/|[^/]+\.[^/]+$)" {
$HTTP["url"] !~ "^/(en|ja)/" {
$HTTP["language"] =~ "(en|ja)" {
url.redirect = ( "^/(.*)" => "/%1/$1" )
}
$HTTP["language"] !~ "(en|ja)" {
url.redirect = ( "^/(.*)" => "/en/$1" )
}
}
}
#!/usr/bin/env perl
use strict;
use warnings;
use YAML::XS;
use Storable qw/freeze thaw/;
my $re = qr/test/;
my $re2 = thaw freeze $re;
sub hoge1 :Path('hoge') :Args(2) {}
sub hoge2 :Path('hoge') :Args(1) {}
sub hoge3 :Path('hoge') :Args(0) {}
package MyApp::Controller::Root;
use strict;
use warnings;
use parent 'Catalyst::Controller';
__PACKAGE__->config->{namespace} = '';
use Net::Twitter::OAuth;
my $client = Net::Twitter::OAuth->new(
package App;
use Ark;
1;
package FCGI::ProcManager::Debug;
use strict;
use warnings;
use base qw/FCGI::ProcManager/;
sub pm_manage {
my $res = shift->SUPER::pm_manage(@_);
# manager does not return pm_manage, so below code should run in server only
$0 = 'perl-fcgi (waiting)';