This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use utf8; | |
package Weather; | |
use DateTime; | |
use Web::Scraper; | |
use URI; | |
our $AREA = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
main(@ARGV);exit; | |
sub main { | |
my $path = shift or help(); | |
my $title = shift or help(); | |
my $dir = "$path/$title"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use AE; | |
use AnyEvent::HTTP; | |
use Twiggy::Server; | |
use Plack::Request; | |
use Plack::Session; | |
use Plack::Builder; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use Plack::Request; | |
use Plack::MIME; | |
use Plack::App::Directory; | |
use FindBin; | |
my $java_bin = `which java` =~ s/[\n\r]//gr | |
or die 'Install Java :('; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
# fork of https://github.com/klange/nyancat | |
package Nyancat; | |
use Time::HiRes 'sleep'; | |
local $SIG{INT} = sub { | |
print "\033[?25h\033[0m"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PRAGMA foreign_keys=OFF; | |
BEGIN TRANSACTION; | |
CREATE TABLE posts ( | |
url TEXT UNIQUE, | |
title TEXT NOT NULL, | |
time INT NOT NULL | |
); | |
INSERT INTO "posts" VALUES('http://mt.endeworks.jp/d-6/2011/10/yapcasia-tokyo-2011-1.html',' YAPC::Asia Tokyo 2011 1日目・・・ - D-6 [相変わらず根無し] ',1318714947); | |
INSERT INTO "posts" VALUES('http://d.hatena.ne.jp/punitan/20111016/1318722529','YAPC::Asia 2011 に行ってきた - punitan (a.k.a. punytan) のメモ',1318722554); | |
INSERT INTO "posts" VALUES('http://mt.endeworks.jp/d-6/2011/10/yapcasia-tokyo-2011-backend-apps.html',' YAPC::Asia Tokyo 2011のシステム - D-6 [相変わらず根無し] ',1318723098); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Benchmark for decode/encode large data structure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ perl benchmark/deserialize.pl | |
-- deserialize | |
JSON::XS: 2.3 | |
Data::MessagePack: 0.34 | |
Storable: 2.29 | |
Benchmark: running json, mp, storable for at least 1 CPU seconds... | |
json: 1 wallclock secs ( 1.03 usr + 0.00 sys = 1.03 CPU) @ 77544.66/s (n=79871) | |
mp: 1 wallclock secs ( 1.03 usr + 0.00 sys = 1.03 CPU) @ 98247.57/s (n=101195) | |
storable: 1 wallclock secs ( 1.09 usr + 0.00 sys = 1.09 CPU) @ 71739.45/s (n=78196) | |
Rate storable json mp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Benchmark; | |
use JSON; | |
use LWP::UserAgent; | |
use Storable; | |
use MIME::Base64; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!perl -w | |
use common::sense; | |
use AnyEvent; | |
use Data::Dumper; | |
sub sleep_sort { | |
my @args = @_; | |
my @output; |
NewerOlder