Skip to content

Instantly share code, notes, and snippets.

@ysasaki
ysasaki / cpanfile
Created April 17, 2013 05:46
Re: file_get_contents的な事がやりてえんだよ! http://uzulla.hateblo.jp/entry/2013/04/17/133330
requires 'IO::All';
requires 'IO::All::LWP';
@ysasaki
ysasaki / plack-middleware-serverstatus-lite
Last active December 15, 2015 12:38
Munin plugin for Plack::Middleware::ServerStatus::Lite
#!/usr/bin/perl
=pod
=head1 NAME
plack-middleware-serverstatus-lite - Munin plugin for Plack::Middleware::ServerStatus::Lite
=head1 INSTALL
@ysasaki
ysasaki / cpanm-test-only.pl
Created March 22, 2013 10:30
Build script for GitLab CI
#!perl
use strict;
use warnings;
use File::Path;
use File::Basename;
unless ( -e 'cpanm' ) {
run(qw(curl -ksS -L http://cpanmin.us -o cpanm));
}
@ysasaki
ysasaki / README.md
Last active December 14, 2015 23:39
gitlab c90a98c55 の修正。daemontoolsの利用を想定。
  • daemontoolsを利用するので、envdirで$PATH, $CONFIG, $MODEの設定をすること
  • sidekiqの -e $MODE の指定をしないとdevelopmentとしてconfigを見るので注意
  • gemにあるforeman(0.60.2)だとcpu loadが跳ね上がったので、Gemfile, Gemfile.lockを書き換えて最新のforemanをgitからinstallするよう変更
  • high cpu load with foreman 0.60.2
@ysasaki
ysasaki / gif-loop.pl
Created March 15, 2013 05:08
Imagerでanimation gifの書き出し
#!/usr/bin/env perl
use v5.16;
use strict;
use warnings;
use Imager;
say "Imager version => $Imager::VERSION";
my @images;
@ysasaki
ysasaki / fix-multibyte-characters-problem.patch
Created February 14, 2013 03:09
Net::Twitter::Queueのマルチバイト文字の文字化けを修正するpatch
diff --git lib/Net/Twitter/Queue.pm lib/Net/Twitter/Queue.pm
index f826077..fb2a12e 100644
--- lib/Net/Twitter/Queue.pm
+++ lib/Net/Twitter/Queue.pm
@@ -39,6 +39,7 @@ Net::Twitter::Queue each day to post a tweet:
use Carp;
use Net::Twitter 3.12000;
use YAML::Any 0.70 qw(LoadFile DumpFile);
+use Encode qw(decode_utf8);
@ysasaki
ysasaki / toggetter.css
Created January 8, 2013 01:37
toggetterのデコレーションを無効化するuser css
.tweet {
font-size: 1.0em;
font-weight: normal;
color: black;
}
.tweet span {
font-size: 1.0em;
font-weight: normal;
color: black;
[root@localhost .cpan]# cpan
Terminal does not support AddHistory.
cpan shell -- CPAN exploration and modules installation (v1.9402)
Enter 'h' for help.
cpan[1]> o conf
$CPAN::Config options from '/usr/share/perl5/CPAN/Config.pm':
commit [Commit changes to disk]
defaults [Reload defaults from disk]
@ysasaki
ysasaki / gist:3978801
Created October 30, 2012 07:34
AnyEvent::Handle on_error時の再接続処理
#!/usr/bin/env perl
use v5.14;
use warnings;
use AnyEvent;
use AnyEvent::Socket;
use AnyEvent::Handle;
use Log::Minimal;
use Test::TCP qw(empty_port wait_port);
use Scalar::Util qw(refaddr);