Skip to content

Instantly share code, notes, and snippets.

@ysasaki
ysasaki / build.log
Last active December 18, 2015 14:19
cpanm -v CSS::Sass. move ppport.h to lib/CSS/ directory then I can install this module.
cpanm (App::cpanminus) 1.6916 on perl 5.018000 built for darwin-2level
Work directory is /Users/ysasaki/.cpanm/work/1371470301.3213
You have make /usr/bin/make
You have LWP 6.05
You have /usr/bin/tar: bsdtar 2.8.3 - libarchive 2.8.3
You have /usr/bin/unzip
Searching CSS::Sass on cpanmetadb ...
--> Working on CSS::Sass
Fetching http://search.cpan.org/CPAN/authors/id/D/DA/DAVID/CSS-Sass-v0.3.0.tar.gz ... OK
Unpacking CSS-Sass-v0.3.0.tar.gz
@ysasaki
ysasaki / return-undef.t
Last active December 18, 2015 10:49
return と return undef の違いを説明するときに使用したコード。list contextの場合に挙動が異なる
use utf8;
use strict;
use warnings;
use Test::More;
use Test::Name::FromLine;
sub return_only { return }
sub return_undef { return undef }
subtest 'scalar context' => sub {
@ysasaki
ysasaki / errno-bench.pl
Created June 12, 2013 08:46
Errnoのtieインターフェイスと定数インターフェイスのベンチマーク
use strict;
use warnings;
use feature 'say';
use Benchmark 'cmpthese';
use Errno;
open my $fh, '<', 'no-such-file';
cmpthese(
0,
{ 'tie' => sub { $!{ENOENT} },
@ysasaki
ysasaki / console-log
Last active December 18, 2015 08:39
追記: Minilla v0.5.2で修正済み Fooのminil test実行時に、依存モジュールTest::Name::FromLine(Minilla使用)がインストール実行されるが、その際にauthor testも実行されている
# Minillaでテスト用のdistを作成
vm-ubuntu /tmp% minil new Foo
Writing lib/Foo.pm
Writing Changes
Writing t/00_compile.t
Writing .travis.yml
Writing .gitignore
Writing LICENSE
Writing cpanfile
Initializing git Foo
use strict;
use warnings;
use feature qw/say/;
sub my_map(&@) {
my ( $block, @list ) = @_;
$block->($_) for @list;
}
my @list = qw(foo bar);
% cpanm -L local/ -v Text::[email protected]
cpanm (App::cpanminus) 1.6914 on perl 5.014002 built for i686-linux
Work directory is /home/ysasaki/.cpanm/work/1370846095.23203
You have make /usr/bin/make
You have LWP 6.03
You have /bin/tar: tar (GNU tar) 1.26
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
@ysasaki
ysasaki / asset-middleware.md
Last active December 18, 2015 07:29
JavaScript, CSS周りのPlack::Middleware::*のまとめ
  • Plack::Middleware::Compile
    • coffee, sass, less等をcompileするけど、自分で設定をごりごり書く
    • concatはしてくれない
  • Plack::Middleware::StaticShared
    • 一番良い感じ
    • versioningとcacheにも対応
    • URLが独特で気持ち悪い ./shared.js:v1:/js/foolib.js,/js/barlib.js
    • URLでconcatするファイルを指定できるので、複数のパターンでconcatすることもできる
    • concatはurlから自動で行う
  • minifyは自分でfilterを設定する必要あり
@ysasaki
ysasaki / .zshrc.perlsource
Created June 10, 2013 03:07
moduleのsourceを直接開くfunction。適当な場所に保存して、 > echo "source ~/.zshrc.perlsource" >> ~/.zshrc.mine
perlsource() {
if [ $# -ne 0 ]; then
perldoc -m $1 | view - +"set filetype=perl"
else
echo "Usage: perlsource MODULE"
fi
}
ysasaki@mba02 ysasaki% vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jun 20 2012 13:16:02)
Compiled by [email protected]
Normal version without GUI. Features included (+) or not (-):
-arabic +autocmd -balloon_eval -browse +builtin_terms +byte_offset +cindent
-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
-conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con +diff +digraphs
-dnd -ebcdic -emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path
+find_in_path +float +folding -footer +fork() -gettext -hangul_input +iconv
+insert_expand +jumplist -keymap -langmap +libcall +linebreak +lispindent
use utf8;
use strict;
use warnings;
use Test::More;
use Test::Name::FromLine;
use Test::TCP;
use Net::SMTP;
use Net::SMTP::Server;
use Net::SMTP::Server::Client;