Skip to content

Instantly share code, notes, and snippets.

View kazuph's full-sized avatar

Kazuhiro Homma kazuph

View GitHub Profile
@kazuph
kazuph / yapc2013.pl
Last active December 23, 2015 17:08
YAPC::Asia 2013の感想ブログで特定のワードに対して言及があったかどうかだけ検出するスクリプト
#!/usr/bin/env perl
use common::sense;
use Furl;
use Web::Query;
use HTML::TagParser;
use Data::Dump qw/dump/;
use Term::ANSIColor qw(:constants);
die "Usage: perl yapc2013.pl [keyword]" unless $ARGV[0];
@kazuph
kazuph / vimrc
Last active December 23, 2015 05:49
vimrc_neo
" ___ ___ ___ ___
" |\__\ /\ \ /\ \ /\ \
" | | | / \ \ / \ \ / \ \
" | | | / /\ \ \ / /\ \ \ / /\ \ \
" | |__|__ / \~\ \ \ / \~\ \ \ / / \ \ \
" / \__\ / /\ \ \ \__\ / /\ \ \ \__\ / /__/ \ \__\
" / /~~/~ \/__\ \/ / / \/__\ \/ / / \ \ \ \/__/
" / / / \ / / \ / / \ \ \
" \/__/ / / / \/__/ \ \ \
" / / / \ \__\
@kazuph
kazuph / tamagoya.pl
Last active December 21, 2015 09:59
今日のたまご屋のメニューだけだけターミナルに表示したい(http://www.tamagoya.co.jp/menu/menu.html
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Encode;
use feature 'say';
use Web::Query;
use Time::Piece;
# 以下のページをパースしてメニューだけ表示する
@kazuph
kazuph / file0.txt
Created July 25, 2013 14:33
githubのリポジトリをwgetでだけで取得したい時 ref: http://qiita.com/kazuph/items/73c2eea6e82896bda58c
$ wget --no-check-certificate https://github.com/fluent/fluentd/archive/master.tar.gz
$ tar xpvf master
$ rm master
$ ls
fluentd-master
@kazuph
kazuph / bench.pl
Last active December 19, 2015 21:29
riak perl bench
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Benchmark 'cmpthese';
use Data::Riak;
use Data::Riak::Fast;
use Net::Riak;
@kazuph
kazuph / tamagoya_menu.pl
Created June 21, 2013 05:45
たまごやメニュー取得スクリプト
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Encode;
use feature 'say';
use Web::Query;
use Time::Piece;
my $menu_list = [];
@kazuph
kazuph / auto_growlnotify.sh
Last active December 15, 2015 21:29 — forked from mirakui/auto_growlnotify.sh
何かのインストールなどの長い処理のときにgrowlで通知してくれるzsh growlが使えるときのみ発動するようにしてみた
# source: http://d.hatena.ne.jp/umezo/20100508/1273332857
local COMMAND=""
local COMMAND_TIME=""
precmd() {
if [ "$COMMAND_TIME" -ne "0" ] ; then
local d=`date +%s`
d=`expr $d - $COMMAND_TIME`
if [ "$d" -ge "30" ] ; then
COMMAND="$COMMAND "
@kazuph
kazuph / ff.sh
Created April 6, 2013 05:42
FFのキャラをTerminalに表示させる
curl https://gist.github.com/valvallow/5202862/raw/c21cb0fd0149fbdb9d1c7e0f606fb1408e827060/batz.dat | perl -pe 's{ }{ }g;s{(\d)}{\e[4\1m \e[0m}g;'
curl https://gist.github.com/valvallow/5202862/raw/8943ab5199f78b8b62ef490bcdb2f6ed52cf91f1/galuf.dat | perl -pe 's{ }{ }g;s{(\d)}{\e[4\1m \e[0m}g;'
curl https://gist.github.com/valvallow/5202862/raw/8a3ec94561fec0bd075549d9a7f6bedec1d27fa6/kuromadousi.dat | perl -pe 's{ }{ }g;s{(\d)}{\e[4\1m \e[0m}g;'
curl https://gist.github.com/valvallow/5202862/raw/a16101f89d9f3c24bb6442a6dfa5e4135c5a3c0b/siromadousi.dat | perl -pe 's{ }{ }g;s{(\d)}{\e[4\1m \e[0m}g;'
curl https://gist.github.com/ywatase/5319618/raw/f3aadad2efff5274a1b6e36cdac5090973d9c5e5/akamadousi.dat | perl -pe 's{ }{ }g;s{(\d)}{\e[4\1m \e[0m}g;'
curl https://gist.github.com/ywatase/5319618/raw/13c94fc67f7656b2cd63d6c2a59bf593e0b3de5b/knight.dat | perl -pe 's{ }{ }g;s{(\d)}{\e[4\1m \e[0m}g;'
@kazuph
kazuph / _plenv
Last active December 15, 2015 18:09
plenvのzsh補完をするためのScript。zshrcへ追加で使える。
_plenv() {
# cmdsという変数を定義
local -a cmds
# カーソルが現在何番目のコマンドを入力しようとしてるのかがCURRENTに入ってる
# すでにplenvと打っているはずなので補完は2コマンド目から
# 3番目以降のコマンドを入力しようとしているときにはelseへ行く
if (( CURRENT == 2 ));then
compadd init rehash exec which version help global local install list versions list_modules install_cpanm available migrate_modules
@kazuph
kazuph / kytprof_success_test.pl
Created March 23, 2013 12:56
Devel::KYTProfでうまくいくバージョン
#!/usr/bin/env perl
use strict;
use warnings;
use Text::Xslate;
use Devel::KYTProf;
use Data::Section::Simple;
Devel::KYTProf->add_prof(
"Text::Xslate",
"render",