Skip to content

Instantly share code, notes, and snippets.

View mackee's full-sized avatar

mackee mackee

  • KAYAC Inc.
  • Japan
View GitHub Profile
#!/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/;
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
[- 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: が
#!/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();
use strict;
use warnings;
sub hoge {
return ('aaa');
}
sub foo {
my @a = ('aaa');
return @a;
use strict;
use warnings;
use Test::MockTime ':all';
use Time::Piece::Plus;
use Test::More;
use YAPC;
subtest 'is_yet()' => sub {
#!/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'
};
package main
import (
"bytes"
"io"
"log"
"net/http"
)
var broadcastMessages = make(chan []byte)
@mackee
mackee / gist:3d135cee3894afa05682
Last active August 29, 2015 14:02
kuiperbelt broadcast test

1 connection

Running 30s test @ http://kuiperbelt:8080/broadcast
  8 threads and 400 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    10.72ms    3.60ms  41.18ms   73.30%
    Req/Sec     4.85k   734.00     6.69k    73.54%
  1143522 requests in 30.00s, 146.13MB read
Requests/sec:  38120.60
Transfer/sec:      4.87MB
package main
import (
"encoding/json"
"encoding/xml"
"io"
"log"
"os"
"strings"
)