Skip to content

Instantly share code, notes, and snippets.

Test Summary Report
-------------------
t/Plack-Request/body.t (Wstat: 256 Tests: 2 Failed: 1)
Failed test: 2
Non-zero exit status: 1
t/Plack-Request/content.t (Wstat: 65280 Tests: 0 Failed: 0)
Non-zero exit status: 255
t/Plack-Request/multi_read.t (Wstat: 256 Tests: 1 Failed: 1)
Failed test: 1
Non-zero exit status: 1
{
'module' => 'Plack::Middleware::Session',
opts => {
state => Plack::Session::State::Cookie->new(),
store => Plack::Session::Store::Cache->new(
cache => Cache::Memcached::Fast->new( { servers => [ '127.0.0.1:12345' ] } )
),
}
},
#macro.inc
[%- MACRO hoge() BLOCK %]
hoge
[% END %]
#index.tx
Hello Macro [% hoge() %]
#
my $xslate = Text::Xslate->new(
</div><!-- /mainContent -->
[% WRAPPER 'footer.inc' INTO footer_content %]
<script>
function myJsRun(){}
myJsRun();
</script>
[% END %]
use warnings;
use strict;
use Test::More;
use Data::Section::Simple;
use Text::Xslate;
my $reader = Data::Section::Simple->new(__PACKAGE__);
my $templates = $reader->get_data_section;
my $tx = Text::Xslate->new(
@tomyhero
tomyhero / gist:833544
Created February 18, 2011 11:03
args encode patch
diff -x .git -urN Pickles-origin/lib/Pickles/Plugin/Encode.pm Pickles/lib/Pickles/Plugin/Encode.pm
--- Pickles-origin/lib/Pickles/Plugin/Encode.pm 2011-02-18 18:52:18.000000000 +0900
+++ Pickles/lib/Pickles/Plugin/Encode.pm 2011-02-18 19:58:34.000000000 +0900
@@ -19,6 +19,17 @@
my $ie = $config->{input_encoding} || 'utf-8';
_decode( $c->req->query_parameters, $ie );
_decode( $c->req->body_parameters, $ie );
+ for my $key (keys %{$c->args}){
+ if( ref $c->args->{$key} eq 'ARRAY'){
+ my $array = $c->args->{$key};
@tomyhero
tomyhero / gist:850298
Created March 2, 2011 01:36
addding elsif
sub _decode_args {
my($h, $ie) = @_;
for my $key( keys %{$h} ) {
if ( ref $h->{$key} eq 'ARRAY' ) {
my @values = map { Encode::decode($ie, $_) } @{$h->{$key}};
$h->{$key} = \@values;
}
elsif(ref $h->{$key} ){
# do nithing;
}
@tomyhero
tomyhero / gist:ebbdeea14046905e729c
Created June 23, 2015 05:55
how to check 404 before execute ServeHTTP with goji
package main
import (
"fmt"
"github.com/zenazn/goji"
"github.com/zenazn/goji/web"
"net/http"
)
func main() {
@tomyhero
tomyhero / gist:7cd7e2f1885fac993942
Last active August 29, 2015 14:23
goji db middleware
package middleware
import (
"database/sql"
"fmt"
_ "github.com/go-sql-driver/mysql"
"github.com/zenazn/goji/web"
"net/http"
)