Skip to content

Instantly share code, notes, and snippets.

View note103's full-sized avatar
🏠
Working from home

Hiroaki Kadomatsu note103

🏠
Working from home
View GitHub Profile
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>カレーのレシピ</title>
</head>
<body>
<article>
#!/usr/bin/env perl
use strict;
use warnings;
# 1
my %japan = (
tokyo => [ 'gotanda', 'shibuya', ],
osaka => [ 'shinsaibashi', ],
okinawa => [ 'naha', 'yomitan', ],
hokkaido => [ 'sapporo', 'obihiro', ],
#!/usr/bin/env perl
use strict;
use warnings;
my %dog = (
name => 'Taro',
color => 'brown',
);
my %cat = (
name => 'Tama',
#!/usr/bin/env perl
use strict;
use warnings;
my @dog = ( 'shiba', 'bulldog' );
my @cat = ( 'mike', 'abyssinian' );
my @bird = ( 'eagle', 'crow' );
my @animal = (\@dog, \@cat, \@bird);
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': {
# requirements: cho
# https://github.com/mattn/cho
function gbs {
local dest=$(git branch | sed -e 's/ *//' | cho)
dest=${dest##\* } # 現在のブランチを選択した場合の処理
git checkout $dest
}
inoremap <silent><Leader><Leader>z [0-9a-zA-Z@$%#&*;:?|,.]<ESC>$v0d
" 1. 上記をvimrcに入れて挿入モード時に全角検索用の文字列をヤンク
" 2-1. vim-easymotionの easymotion-sn コマンドと組み合わせてサーチ
" 2−2. この際、コマンドラインに貼り付けるには <C-r>" を使う
" 3. 一旦検索されたら以後は ; と , で前後に検索可能&その時にはハイライトされる
" 個人的にはこのハイライトがありがたいというかそもそもの目的
" 最初はクエリを [^\x01-\x7E] としていたけど考えてみたら自分は日本語むっちゃ使うのでそれでは駄目だった。単純に拾いたくない全角英数記号だけを対象に絞り直した
" GIF movie
@note103
note103 / line_count.pl
Last active December 8, 2016 02:46
そのディレクトリにある各ファイルの行数を出すやつ
#!/usr/bin/env perl
use strict;
use warnings;
use File::Slurp;
my @iter = glob "*";
my $sum = 0;
for (@iter) {
next if (-d $_);
" 改行時にインデントを一段深くする
nnoremap <Leader>rt A<CR><ESC>I<TAB><ESC>A
" 同階層インデントのまま改行
nnoremap <Leader>ri A<CR>
" インデント解除して改行
nnoremap <Leader>rh o<ESC>I
" 行頭ハイフンのリスト化
@note103
note103 / vote.pl
Last active December 2, 2016 15:13
Perl入学式 #3 復習問題
#!/usr/bin/env perl
use strict;
use warnings;
use feature 'say';
# 1-1
my $foo = {name => 'note103', favorite_foods => [qw( ramen rice apple )]};
my $bar = {name => 'alice' , favorite_foods => [qw( ramen kimuchi orange apple )]};
my $baz = {name => 'bob' , favorite_foods => [qw( ramen meet kimuchi orange banana )]};