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:3078484
Created July 9, 2012 19:47
Twitter検索した結果(json)を渡して、instagramのリンクから画像を落とすやつ
#!/usr/bin/env perl
use strict;
use warnings;
use JSON::XS;
use LWP::Simple;
if ( scalar @ARGV != 1 ) {
die"Usage: perl $0 <twitter_search_result.json>";
@soh-i
soh-i / gist:3089325
Created July 11, 2012 09:43
Rをbatch modeで実行してFigureをたくさん描く
#!/usr/bin/env perl
use strict;
use warnings;
use 5.16.0;
##
## This script makes figures that phosphorylation sites given specify output data by R batch mode.
##
@soh-i
soh-i / gist:3121343
Created July 16, 2012 07:25
get_instagram
#!/usr/bin/evn perl
use strict;
use warnings;
use 5.17.0;
use LWP::UserAgent;
use LWP::Simple;
use JSON qw/decode_json/;
@soh-i
soh-i / gist:3122082
Created July 16, 2012 10:42
ラーメン二郎の画像をinstagramから700枚くらい集めた
#!/usr/bin/env perl
use strict;
use warnings;
use 5.17.0;
use LWP::UserAgent;
use LWP::Simple;
use JSON qw/decode_json/;
@soh-i
soh-i / gist:3206360
Created July 30, 2012 11:36
SeqAnのチュートリアル
#include <iostream>
#include <string>
#include <seqan/sequence.h>
using namespace std;
int main () {
seqan::String<char> text = "this is test using by seqan";
seqan::String<char> pattern = "test";
@soh-i
soh-i / gist:3206597
Created July 30, 2012 12:39
アライメント
#include <iostream>
#include <string>
#include <seqan/sequence.h>
#include <seqan/align.h>
using namespace seqan;
int main ()
{
@soh-i
soh-i / gist:3339265
Created August 13, 2012 10:40
Kobito.appで管理されてるDBを取り出す
#!/usr/bin/env perl
use strict;
use warnings;
use DBIx::Simple;
my $db = DBIx::Simple->connect('dbi:SQLite:dbname=./Kobito.db') || die DBIx::Simple->error;
my $result = $db->query('select ZCREATED_AT, ZTITLE, ZRAW_BODY, ZBODY from ZITEM') || die $db->error;
@soh-i
soh-i / ho.pl
Last active October 8, 2015 18:38
文字と数字の混在したデータをソートする
#!/usr/bin/env perl
use strict;
use warnings;
my @list = ( 3, '_hoge', 1, 'Y', 'X', 2, 23, 64, 123, 90, 11, 12, 21, 23);
my @sorted = sort chromosome_sort @list;
print join(", ", @sorted)."\n";
@soh-i
soh-i / gist:3391085
Created August 19, 2012 02:26
cperl-mode
;; cperl-mode
(defalias 'perl-mode 'cperl-mode)
(setq auto-mode-alist (cons '("\\.t$" . cperl-mode) auto-mode-alist))
(add-hook 'cperl-mode-hook
'(lambda ()
(cperl-set-style "PerlStyle")))
(setq cperl-highlight-variables-indiscriminately t)
(add-hook 'cperl-mode-hook
'(lambda ()
(font-lock-mode 1)
@soh-i
soh-i / gist:3447120
Created August 24, 2012 07:31
ポジションの情報join(start..end)のバリデーター
sub sort_region {
    
    my $start = shift;
    my $end   = shift;
    
    if ( $start < $end ) {
        my $join = "$start..$end";
        return scalar $join;
    }