Skip to content

Instantly share code, notes, and snippets.

@shiba-yu36
shiba-yu36 / app.psgi
Created June 28, 2011 10:57 — forked from motemen/app.psgi
Git log chat
use strict;
use warnings;
use opts;
use autodie;
use Plack::Request;
use File::Path qw(mkpath);
use File::chdir;
use Sys::Hostname;
use Text::MicroTemplate qw(render_mt);
@shiba-yu36
shiba-yu36 / encode_guess_all_character_code.pl
Created June 8, 2011 10:44
Encode::Guessで判定失敗したときに、全ての文字コードを試してみる例
use strict;
use warnings;
use utf8;
use Encode;
use Encode::Guess qw/ascii utf8 euc-jp shiftjis 7bit-jis/;
my $presence_list = [qw(
出席 出 しゅっせき
)];
@shiba-yu36
shiba-yu36 / my-schema.pm
Created March 17, 2011 14:56
schema設定のほう
package My::Schema;
use strict;
use warnings;
use Teng::Schema::Declare;
Teng::Schema::Declare->load_plugin('Column::DateTime');
table {
name "tags";
pk "id";
@shiba-yu36
shiba-yu36 / memoize_sample.pl
Created March 16, 2011 17:08
MemoizeとAttribute::Memoize
use strict;
use warnings;
use Memoize qw(flush_cache);
my $t = test::Cache->new;
warn $t->rand_method('test2');
warn $t->rand_method('test1');
warn $t->rand_method('test2');
warn $t->rand_method('test1');
@shiba-yu36
shiba-yu36 / not_die_perl5_8_9.pl
Created February 16, 2011 05:05
なんで死なないのかわかりません
use strict;
use warnings;
my $test = undef;
for my $p (@{ $test }) {
warn '=========';
}
@shiba-yu36
shiba-yu36 / not_die_perl5.pl
Created February 15, 2011 06:20
なんで死なないのかよくわからない。perl5.8.9使ってる
use strict;
use warnings;
my $test = undef;
for my $p (@{ $test }) {
}
@shiba-yu36
shiba-yu36 / error.txt
Created January 20, 2011 12:23
バグ?使い方悪い?
This page was generated from the template "templates/exception.html.ep".
Oops: Unknown opcode 'super' on [5] at /Users/shibazaki/perl5/perlbrew/perls/perl-5.8.9/lib/site_perl/5.8.9/darwin-2level/Text/Xslate.pm line 288.
283: my $cache_mtime;
284: if($self->{cache} < 2) {
285: $cache_mtime = $fi->{cache_mtime} || 0;
286: }
287:
288: $self->_assemble($asm, $file, $fi->{fullpath}, $fi->{cachepath}, $cache_mtime);
@shiba-yu36
shiba-yu36 / set_cookie.pl
Created January 18, 2011 02:25
LWP::UserAgentにcookieをセットするsample
@shiba-yu36
shiba-yu36 / keysnail-install-plugin-from-this-page.ks.js
Created December 30, 2010 08:02
今のページからkeysnailプラグインをインストールするためのスニペット
key.setGlobalKey(['C-c', 'i'], function (ev, arg) {
userscript.installPluginFromURL(window.content.document.location.href);
}, 'install-plugin-from-this-page');