Skip to content

Instantly share code, notes, and snippets.

@shiba-yu36
shiba-yu36 / app.psgi
Created Jun 28, 2011 — forked from motemen/app.psgi
Git log chat
View app.psgi
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 Jun 8, 2011
Encode::Guessで判定失敗したときに、全ての文字コードを試してみる例
View encode_guess_all_character_code.pl
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 Mar 17, 2011
schema設定のほう
View my-schema.pm
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 Mar 16, 2011
MemoizeとAttribute::Memoize
View memoize_sample.pl
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 Feb 16, 2011
なんで死なないのかわかりません
View not_die_perl5_8_9.pl
use strict;
use warnings;
my $test = undef;
for my $p (@{ $test }) {
warn '=========';
}
@shiba-yu36
shiba-yu36 / not_die_perl5.pl
Created Feb 15, 2011
なんで死なないのかよくわからない。perl5.8.9使ってる
View not_die_perl5.pl
use strict;
use warnings;
my $test = undef;
for my $p (@{ $test }) {
}
@shiba-yu36
shiba-yu36 / error.txt
Created Jan 20, 2011
バグ?使い方悪い?
View error.txt
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 Jan 18, 2011
LWP::UserAgentにcookieをセットするsample
View set_cookie.pl
@shiba-yu36
shiba-yu36 / keysnail-install-plugin-from-this-page.ks.js
Created Dec 30, 2010
今のページからkeysnailプラグインをインストールするためのスニペット
View keysnail-install-plugin-from-this-page.ks.js
key.setGlobalKey(['C-c', 'i'], function (ev, arg) {
userscript.installPluginFromURL(window.content.document.location.href);
}, 'install-plugin-from-this-page');