Skip to content

Instantly share code, notes, and snippets.

View hisaichi5518's full-sized avatar
💙
Flutter!

hisaichi5518 hisaichi5518

💙
Flutter!
View GitHub Profile
function gomi() {
cd $HOME/projects/gomi
GOMI_TIME=`date +"%s"`
touch "$GOMI_TIME.pl"
vi "$GOMI_TIME.pl"
}
@hisaichi5518
hisaichi5518 / Web.pm
Created March 14, 2012 06:10
こういう感じでMaltsのto_appを上書きすればいい気がする。
package MyApp::Web;
use 5.10.1;
use strict;
use warnings;
use parent qw/Malts Malts::Web/;
use Log::Minimal;
# ...略
sub to_app {
cpanm (App::cpanminus) 1.5007 on perl 5.014002 built for darwin-2level
Work directory is /Users/hisaichi5518/.cpanm/work/1338806361.18022
You have make /usr/bin/make
You have LWP 6.02
You have /usr/bin/tar: bsdtar 2.8.3 - libarchive 2.8.3
You have /usr/bin/unzip
--> Working on https://github.com/typester/Path-AttrRouter/tarball/master
Fetching https://github.com/typester/Path-AttrRouter/tarball/master
-> OK
Unpacking master
package t::Util;
use strict;
use warnings;
use Malts::Test ();
use Exporter 'import';
our @EXPORT = qw/apptest/;
my $builder = Test::More->builder;
@hisaichi5518
hisaichi5518 / yaminabe.txt
Created December 12, 2012 11:01
chankoっぽいの考えたけどきつかった。
# in templates/root/index.tx
# active_ifが真でなければ無視
# 真なら include yaminabe/name/templates/root/index.test.tx
$c.yaminabe.invoke('name', 'tag');
# in yaminabe/name/templates/root/index.tag.tx
<p><a href="<: uri_for('/user/like') :>">like</a></p>
package Yaminabe::App::Name;
use strict;
@hisaichi5518
hisaichi5518 / hisaichi5518.md
Last active October 13, 2015 22:38
hisaichi5518 style.

はじめに

  • ゆるふわ
  • perldoc perlstyle
  • これが絶対ではない。常によい方向へ。
  • 綺麗なコード=Larry Wallが書いたコード, 多くの人が書くコード
  • Larryの考えは変わる。みんなも変わる。なので綺麗なコードも変わる。

全てのコードにuse strict; use warnings;を付ける。

use strict;
use warnings;
use utf8;
use Plack::Util;
use Encode;
use AnyEvent;
use AnyEvent::HTTP ();
$AnyEvent::HTTP::MAX_PER_HOST = 20;
use strict;
use warnings;
use utf8;
use 5.10.1;
package Parent {
use Mouse;
no Mouse;
use strict;
use warnings;
use utf8;
use 5.10.1;
package Parent {
use Mouse;
no Mouse;
use Data::Dumper;
use Data::Dummy;
my %hash = (
id => dummy_int([1..100]),
name => dummy_str(["あ".."ん"]),
name_long => dummy_str(["あ".."ん"], size => 50),
);
my @array = (
dummy_int([1..100]),