Skip to content

Instantly share code, notes, and snippets.

View soh-i's full-sized avatar

Soh Ishiguro soh-i

View GitHub Profile
@soh-i
soh-i / gist:3731824
Created September 16, 2012 09:52
適当にiPhotoのバックアップ
#!/usr/bin/env perl -w
use strict;
use File::Copy;
use FileHandle;
my $user = getpwuid($>);
my $from_dir = "/Users/$user/Pictures/iPhoto\ Library/Originals";
my $to_dir = "/Users/$user/Desktop";
@soh-i
soh-i / gist:3754778
Created September 20, 2012 09:01
Numbers.appの変なCSVをまともなTSVにエクスポートする
#!/usr/bin/env perl -w
use strict;
# Convert CSV file that exported by Apple Numbers.app to TSV
my $file = shift || die;
open my $fh, '<', $file || die;
while ( my $entry = <$fh> ) {
@soh-i
soh-i / gist:3765304
Created September 22, 2012 06:02
可愛さ

Install

brew install figlet

Usage

figlet -w outputwidth -f font

ほら

figlet -w 200 -f roman Hatena::One

ooooo ooooo . .oooooo. 
@soh-i
soh-i / gist:3795009
Created September 27, 2012 16:37
はてなブログのCSS
/* <system section="theme" selected="report"> */
@import "/css/theme/report/report.css";
/* </system> */
div#google_afc_user {
visibility: hidden;
}
a{
color:#4682B4;
@soh-i
soh-i / gist:3806345
Created September 30, 2012 09:40
ディレクトリ内のファイル名と更新日時の取得
#!/usr/bin/env perl
use strict;
use warnings;
use Date::Format;
use File::stat;
opendir my $dir, './' || die;
foreach my $file ( readdir($dir) ) {
if ( -f $file && $file =~ m/^.+md$|^.+txt$/ ) {
@soh-i
soh-i / gist:3806558
Created September 30, 2012 11:49
perlからtwitterに投稿する
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Encode;
use Net::Twitter::Lite;
use Data::Dumper;
@soh-i
soh-i / gist:3833095
Created October 4, 2012 11:39
historyコマンドから今日叩いたコマンドを表示する
#!/usr/bin/env perl
use strict;
use DateTime;
use Data::Dumper;
my $hist_file = '/home/soh.i/.zsh_history';
unless ( -e $hist_file ) {
die "Cant open .zsh_history";
@soh-i
soh-i / gist:3887538
Last active October 11, 2015 16:37
zshrc
# zaw.zsh
autoload -Uz chpwd_recent_dirs cdr add-zsh-hook
add-zsh-hook chpwd chpwd_recent_dirs
zstyle ':chpwd:*' recent-dirs-max 5000
zstyle ':chpwd:*' recent-dirs-default yes
zstyle ':completion:*' recent-dirs-insert both
source /home/soh.i/.zsh/zaw/zaw.zsh
zstyle ':filter-select' case-insensitive yes
zstyle ':filter-select' max-lines 10
@soh-i
soh-i / gist:3930068
Created October 22, 2012 07:11
サーバーによって使うemacsのバージョンを変更する
# love of emacs
# .zshrcに記述する
hostname=`hostname`
new_server='fat' #新しいマシン
watson='watson' #古めのマシン
click='click' #おじいちゃんマシン
if [ ${hostname} = ${click} ] || [ ${hostname} = ${watson} ] ; then
old_emacs='/usr/bin/emacs -nw'
new
load myfile.bam
snapshotDirectory mySnapshotDirectory
genome hg18
goto chr1:65,289,335-65,309,335
sort position
collapse
snapshot
goto chr1:113,144,120-113,164,120
sort base