This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| use utf8; | |
| use feature 'say'; | |
| my $switch = 'o'; | |
| #my $switch = 'u'; | |
| my %count; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| use feature 'say'; | |
| { | |
| my $count = 0; | |
| sub counter { | |
| say $count++; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/ruby | |
| # http://magazine.rubyist.net/?0009-YAML | |
| # | |
| # 引数を使う場合 | |
| #str = ARGF.read() # 入力をすべて読み込む | |
| #data = YAML.load(str) # パースする | |
| # | |
| # コード上でファイルを指定する場合 | |
| #data = YAML.load_file('data.yml') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| my @array = <DATA>; | |
| my $n = 1; | |
| for my $line (@array) { | |
| print "$n: $line"; | |
| $n++; | |
| } | |
| __DATA__ | |
| apple | |
| orange | |
| lemon |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " 改行時にインデントを一段深くする | |
| nnoremap <Leader>rt A<CR><ESC>I<TAB><ESC>A | |
| " 同階層インデントのまま改行 | |
| nnoremap <Leader>ri A<CR> | |
| " インデント解除して改行 | |
| nnoremap <Leader>rh o<ESC>I | |
| " 行頭ハイフンのリスト化 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| use feature 'say'; | |
| # 1. 以下の無名サブルーチンがあったとして、 | |
| my $f = sub { | |
| my $s = shift; | |
| for my $i (@$s) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let g:lightline = { | |
| \ 'colorscheme': 'seoul256', | |
| \ 'mode_map': {'c': 'NORMAL'}, | |
| \ 'active': { | |
| \ 'right': [ [ 'syntastic', 'lineinfo' ], | |
| \ [ 'percent' ], [ 'winform' ], | |
| \ [ 'fileformat', 'fileencoding', 'filetype' ] ], | |
| \ 'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'branch', 'filename' ] ] | |
| \ }, | |
| \ 'component_function': { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let g:lightline = { | |
| \ 'colorscheme': 'seoul256', | |
| \ 'mode_map': {'c': 'NORMAL'}, | |
| \ 'active': { | |
| \ 'right': [ [ 'syntastic', 'lineinfo' ], | |
| \ [ 'percent' ], [ 'winform' ], | |
| \ [ 'fileformat', 'fileencoding', 'filetype' ] ], | |
| \ 'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'branch', 'filename' ] ] | |
| \ }, | |
| \ 'component_function': { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| nnoremap <C-j>ww <C-w><C-w>ZZ | |
| nnoremap <C-j>wq <C-w><C-w>ZQ | |
| nnoremap <C-j>wj <C-w>jZZ | |
| nnoremap <C-j>wk <C-w>kZZ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| use feature 'say'; | |
| use utf8; | |
| binmode STDOUT, ':utf8'; | |
| use Time::Piece; | |
| use Time::Seconds; | |
| my @data = <DATA>; |