Skip to content

Instantly share code, notes, and snippets.

View mackee's full-sized avatar

mackee mackee

  • KAYAC Inc.
  • Japan
View GitHub Profile
package main
import (
"bytes"
"io"
"log"
"net/http"
)
var broadcastMessages = make(chan []byte)
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use constant {
GITHUB_ENDPOINT => 'https://github.com/%s.keys',
VULTR_ENDPOINT => 'https://api.vultr.com/v1/server/list'
};
use strict;
use warnings;
use Test::MockTime ':all';
use Time::Piece::Plus;
use Test::More;
use YAPC;
subtest 'is_yet()' => sub {
use strict;
use warnings;
sub hoge {
return ('aaa');
}
sub foo {
my @a = ('aaa');
return @a;
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Data::Section::Simple qw/get_data_section/;
use Text::Xslate;
use DDP;
my $vpass = get_data_section();
[- o -] $ perl -MText::MeCab -MDDP -E 'my $mecab = Text::MeCab->new; my $text = "もず氏がまた撮られたがってる"; for (my $node = $mecab->parse($text); $node; $node = $node->next) { say "text: ".$node->surface; say "id: ".$node->id; say "feature :".$node->feature}'
text: も
id: 1
feature :助詞,係助詞,*,*,*,*,も,モ,モ
text: ず
id: 4feature :助動詞,*,*,*,特殊・ヌ,連用ニ接続,ぬ,ズ,ズ
text: 氏
id: 6
feature :名詞,一般,*,*,*,*,氏,シ,シ
text: が
Script started on 2013年06月02日 02時26分17秒
[- o -] $ perl -V
Summary of my perl5 (revision 5 version 16 subversion 3) configuration:
Platform:
osname=linux, osvers=3.6.11+, archname=armv6l-linux
uname='linux raspberrypi 3.6.11+ #371 preempt thu feb 7 16:31:35 gmt 2013 armv6l gnulinux '
config_args='-Dprefix=/home/pi/.plenv/versions/5.16.3 -de -A'eval:scriptdir=/home/pi/.plenv/versions/5.16.3/bin''
hint=recommended, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=undef
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Benchmark qw/cmpthese/;
use Test::mysqld;
use DBI;
use Sys::Ramdisk;
use feature qw/say/;
@mackee
mackee / benchmark.pl
Last active December 17, 2015 20:38
Nornal VS Ramdisk datadir on Test::mysqld
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Benchmark qw/cmpthese/;
use Test::mysqld;
use DBI;
use Sys::Ramdisk;
use feature qw/say/;
#!/usr/bin/env perl
use 5.016;
use warnings;
use Benchmark qw/:all/;
use File::Temp qw/tempfile/;
use Storable qw/nstore retrieve/;
use DateTime::Tiny;
my $code = sub {