Skip to content

Instantly share code, notes, and snippets.

View SpringMT's full-sized avatar

Spring_MT SpringMT

View GitHub Profile
@SpringMT
SpringMT / gist:843391
Created February 25, 2011 05:11
ディスク使用状況
df -lh
@SpringMT
SpringMT / gist:847147
Created February 28, 2011 10:00
後で読む
https://gist.github.com/riywo
@SpringMT
SpringMT / gist:847575
Created February 28, 2011 16:37
twitter memo
#if ( my $followers = $nt->followers ) {
#my $target_user = shuffle( @$followers );
#my $screen_name = $target_user->{screen_name};
#my $text = shuffle( @nanpa_text );
my $text = 'test';
#eval { $text =~ s/name/$screen_name/ };
#$text = "\@$screen_name " . $text;
$nt->update( $text );
warn "$text\n";
#}
@SpringMT
SpringMT / gist:849004
Created March 1, 2011 11:33
minっぽい関数の拡張系CommentsAdd Star
* 入力としてundefあるいは値を複数受け取り
* 結果として値の最小値(あるいは値が全てundefの場合はundef)を返す
my $min_or_undef = List::Util::min(grep { defined $_ } ($a, $b));
@SpringMT
SpringMT / gist:850514
Created March 2, 2011 05:04
ユーザーの容量調べる
sudo du -sh /home/* | sort -n
@SpringMT
SpringMT / gist:850677
Created March 2, 2011 09:16
useしている関数抽出
perl -MGameConf -e 'use Func::hoge; print "$_\n" for keys %INC;'|grep hoge.pm
@SpringMT
SpringMT / gist:850859
Created March 2, 2011 12:38
EUCからUTF-8への文字コードの再帰的変換
find . -type f -name “*.php” -exec nkf -w –overwrite {} \;
“*.php”を”*.html”とすれば、HTMLファイルが変換されます。
http://d7r.com/200910/euc%E3%81%8B%E3%82%89utf-8%E3%81%B8%E3%81%AE%E6%96%87%E5%AD%97%E3%82%B3%E3%83%BC%E3%83%89%E3%81%AE%E5%86%8D%E5%B8%B0%E7%9A%84%E5%A4%89%E6%8F%9B/
http://jp.layer8.sh/reference/entry/show/id/744
@SpringMT
SpringMT / gist:857326
Created March 6, 2011 14:21
exposeの再起動
killall Dock
find . -name '*.html' | xargs perl -pi -e 's#\$INC:common_footer\$\r?\n##g; s#</body>(\r)?$#\$INC:common_footer\$$1\n</body>$1#g;'
@SpringMT
SpringMT / gist:858496
Created March 7, 2011 13:21
irssi導入
brew install irssi
(だった気がする)
http://nekolinux.blogspot.com/2009/05/ircirssi.html
http://webtech-walker.com/archive/2010/02/01090136.html
http://www.binzume.net/library/irssi.html