Skip to content

Instantly share code, notes, and snippets.

@walf443
walf443 / gist:1587228
Created January 10, 2012 05:37
xslate not work?
use strict;
use warnings;
use Text::Xslate;
use Data::Section::Simple qw/get_data_section/;
my $xslate = Text::Xslate->new(syntax => 'TTerse');
render('simple_if');
render('declare_if');
render('problem_case');
make test [ ~/watch/www-mobilecarrierjp master ]
Skip blib/lib/WWW/MobileCarrierJP/ThirdForce/HTTPHeader.pm (unchanged)
Skip blib/lib/WWW/MobileCarrierJP/EZWeb/DeviceID.pm (unchanged)
Skip blib/lib/WWW/MobileCarrierJP/Softbank/PictogramInfo.pm (unchanged)
Skip blib/lib/WWW/MobileCarrierJP/Declare.pm (unchanged)
Skip blib/lib/WWW/MobileCarrierJP/Softbank/Service.pm (unchanged)
Skip blib/lib/WWW/softbank_cidr.pl (unchanged)
Skip blib/lib/WWW/MobileCarrierJP/ThirdForce/Java.pm (unchanged)
Skip blib/lib/WWW/MobileCarrierJP/ThirdForce/PictogramInfo.pm (unchanged)
Skip blib/lib/WWW/MobileCarrierJP/EZWeb/Model.pm (unchanged)
#include <stdlib.h>
#include <stdio.h>
#include <error.h>
int main(int argc, char **argv)
{
int errno;
if ( argc != 2 ) {
fprintf(stderr, "USAGE: %s errno\n", argv[0]);
@walf443
walf443 / gist:1096720
Created July 21, 2011 07:23
OreOre::Exception
package OreOre::Exception;
use strict;
use warnings;
use Carp;
use overload '""' => \&inspect;
sub throw {
my ($class, %args) = @_;
# XXX: エラーの分類別にサブクラスを作るべきなの
@walf443
walf443 / gist:950478
Created May 1, 2011 12:55
DBD::mysqlと5.5.10の組み合わせは相性わるいっぽい?
# どうやらperl5.13.3で内部APIに多少変動がある関係っぽい
PLEASE NOTE:
For 'make test' to run properly, you must ensure that the
database user 'yoshimi' can connect to your MySQL server
and has the proper privileges that these tests require such
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others.
use strict;
use warnings;
use utf8;
use Cache::Memcached::Fast;
use Test::More;
use Encode;
use Data::MessagePack;
use JSON::XS;
my $json_serializer = [sub { JSON::XS->new->utf8->encode(@_) }, sub { JSON::XS->new->utf8->decode(@_) } ];
@walf443
walf443 / gist:791773
Created January 23, 2011 03:15
Teng's pod.
diff --git lib/Teng.pm lib/Teng.pm
index 350a5ce..c6f3cb9 100644
--- lib/Teng.pm
+++ lib/Teng.pm
@@ -603,7 +603,7 @@ It's useful in case use IN statement.
# SELECT * FROM user WHERE id IN (?,?,?);
# bind [1,2,3]
- my $itr = $teng->search_named(q{SELECT * FROM user WHERE id IN :ids}, {id => [1, 2, 3]});
+ my $itr = $teng->search_named(q{SELECT * FROM user WHERE id IN :ids}, {ids => [1, 2, 3]});
use strict;
use warnings;
use Filesys::Notify::Simple;
while ( 1 ) {
my $watcher = Filesys::Notify::Simple->new(['.']);
$watcher->wait(sub {});
print "###############################\n";
my $code = system("scons");
if ( $code == 0 ) {
@walf443
walf443 / gist:730884
Created December 6, 2010 20:21
auto-spork-make.pl
use strict;
use warnings;
use Filesys::Notify::Simple;
use Spork;
use lib 'lib';
while ( 1 ) {
my $watcher = Filesys::Notify::Simple->new(['.']);
$watcher->wait(sub {});
Spork->new->load_hub->command->process('-make', @ARGV);
@walf443
walf443 / autotest.pl
Created November 25, 2010 03:05
特定のテストをつくってるときとかに使うとべんり
use strict;
use warnings;
use Filesys::Notify::Simple;
use Test::Harness;
sub main {
my @targets = @_;
my $run_tests = sub {
# Test::Harnessが勝手にexitしちゃう対策