2010-01-01から1年間の記事一覧
以前インストールしたけどホームに入れ直した。 $ cd node-v0.2.5 $ make uninstall $ ./configure --prefix=/Users/hironorism/node $ make $ make install ~/.bashrcに追記 export NODE_PATH=$HOME/node/.node_libraries:$PATH export PATH=$HOME/node/bin…
Hello Worldレベルで特に中身はない雛形作成 $ mojo generate app MyApp my_appというディレクトリの下に色々作られる。 そしたらとりあえずplackupで確認。 $ cd my_app $ plackup script/my_app 下記にアクセスしてみるとwelcome的なページがでる。 http:/…
gvimのコマンドモードででカレントディレクトリの挿入を再現したかったわけでvimrcに以下を追記 cnoremap <expr> <C-x> getcwd() これだけでも初めてのことなので1時間ぐらいかかったわけで・・・</c-x></expr>
メモしておく $ コマンド > 出力先 2>&1
#!/usr/bin/env perl use strict; use warnings; use DBI; use DBIx::TransactionManager; use Try::Tiny; use Test::More; my $dbh = DBI->connect("dbi:SQLite:"); my $tm = DBIx::TransactionManager->new($dbh); $dbh->do(q{ CREATE TABLE user (id INTE…
#!/usr/bin/env perl use strict; use warnings; use Config::Pit; use AnyEvent::Twitter::Stream; use AnyEvent::Socket; use Data::Section::Simple; use Text::Xslate; use JSON; use HTTP::Parser::XS qw/parse_http_request/; my $config = pit_get('t…
今までperl my_print.plみたいにいちいちやってたのだけど 以下のようにpl2batというコマンドを使えばmy_printだけで実行できるようになる。 C>pl2bat my_print ちなみにpl2batを実行するとmy_print.batという以下のようなファイルが作成されてた。 @rem = '…
オラクルきれい・・・ そして正直ほとんどわからなかった・・・ MySQL Casualは恐ろしい所だった・・・ まあ内容的に"多分"運用のお話が多かったし、 運用全然やったことないんだからわからなくて当たり前っしょ? と終ったあと自分を慰めたよ。。。 でも自…
メモしておこう $ export EDITOR=vim まず$EDITORを設定する。 $ ppit set twitter このコマンドを打つと$EDITORで設定したエディタが開く。 --- { username : user, password : pass } とか打って保存して終了。 これで~/.pit/default.yamlとかに保存される…
今日覚えたこととか。 実はKolonとはあんまり関係ないかもしれない。 #!perl use strict; use warnings; use Encode; use Text::Xslate; use Data::Section::Simple; my $vpath = Data::Section::Simple->new()->get_data_section(); my $tx = Text::Xslate-…
#!perl use strict; use warnings; my $scalar = 'one'; my @array = qw/two three/; my %hash = (four => 'five'); my @ref = \($scalar, @array, %hash); for (@ref) { print ref $_, "\n"; } # 出力結果 # SCALAR # ARRAY # HASH 各要素に対して適用され…
#!perl use strict; use warnings; use DBIx::Skinny; use Text::Xslate; use Data::Section::Simple; my $vpath = Data::Section::Simple->new()->get_data_section(); my $tx = Text::Xslate->new(path => [$vpath]); { package MyModel; use DBIx::Skinny…
単語単位 行単位お初。
package MyForm; use strict; use warnings; use HTML::Shakan::Declare; use FormValidator::Lite::Constraint::Japanese; form 'add' => ( TextField( name => 'katakana', constraints => [ 'KATAKANA' ], ), TextField( name => 'hiragana', constraints…
#!perl use strict; use warnings; use utf8; my $str = 'カタカナ'; if ($str =~ /^\p{InKatakana}+$/) { warn 'match'; } else { warn 'not match'; } 初めて知った。 FormValidator::Liteのソースを読んでたら出くわした。 詳しくはperldoc perlunicodeあ…
起動したらF8連打
#!perl use strict; use warnings; package My::Form; use HTML::Shakan::Declare; form 'add' => ( TextField( name => 'name', label => 'name', constraints => [ [ 'REGEXP' => qr/^[\w]+$/ ], ], ), ); package main; use CGI; use Text::Xslate qw/mar…
memo # キロ $ du -k /home # メガ $ du -m /home なぜかよく忘れる
ファイルの内容をクリップボードに $ pbcopy < hoge.txt
書いた # Ctrl-tに変更 escape ^Tt # 下にタブを表示 hardstatus alwayslastline "%w"
print "@array";とかするときの配列要素の区切り文字は「$"」で変えられる。特殊変数の逆引きが欲しい。
#!perl use strict; use warnings; sub hoge (\[$@%]) { warn ref $_[0]; } my $scalar = 'scalar'; my @array = qw/1 2 3/; my %hash = ( key => 'value' ); hoge $scalar; # SCALAR hoge @array; # ARRAY hoge %hash; # HASH となる。 Readonlyで見た。
何度目かのブログ始める