This file contains hidden or 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 AnyEvent; | |
my $cv_timer = AnyEvent->condvar; | |
my $timer = AnyEvent->timer ( | |
after => 5, | |
interval => 5, | |
cb => sub { | |
my $lines = `ps ax | grep java`; |
This file contains hidden or 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; | |
my $str; | |
my $time = $#ARGV > -1 ? pop : 5; | |
while (<DATA>) { | |
chomp; | |
s/^\s+//; | |
$str .= sprintf ' -e "%s"', $_; |
This file contains hidden or 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
on startRecord() | |
action("1") | |
end startRecord | |
on stopRecord() | |
action("2") | |
end stopRecord | |
on action(src) | |
This file contains hidden or 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 DateTime; | |
my $zone = DateTime::TimeZone->new(name => 'local'); | |
my $start = DateTime->new( | |
time_zone => $zone, | |
year => 2010, |
This file contains hidden or 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
"reference from String::CamelCase | |
function! camelcase#wordsplit(str) | |
return split(a:str, '[_\s]\|[A-Z]\@<![A-Z]\@=\|[A-Z]\@<=[A-Z][a-z]\@=') | |
endfunction | |
function! camelcase#camelize(str) | |
return join(map(split(a:str, '[A-Za-z]\@<=_[A-Za-z]\@='), 'toupper(v:val[0]).v:val[1:]'), '') | |
endfunction |
This file contains hidden or 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
function title_screen() | |
{ | |
screen -X eval "title '$(basename $(pwd))'" | |
} |
This file contains hidden or 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
require 'rake' | |
HOME = ENV["HOME"] | |
CURRENT = Dir.pwd | |
exclude_pattern = /\.$|\.sw.$|.DS_Store|\.svn|\.git$/ | |
_requires = [ | |
'.gvimrc', | |
'.screenrc', | |
'.vimperatorrc', |
This file contains hidden or 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 Data::Dumper; | |
use LWP::UserAgent; | |
return sub { | |
my $req = Plack::Request->new(shift); |
This file contains hidden or 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 LWP::UserAgent; | |
use Cache::FastMmap; | |
my $cache = Cache::FastMmap->new; | |
return sub { |
This file contains hidden or 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 Plack::Request; | |
use Plack::App::File; | |
use LWP::UserAgent; | |
use File::Basename; | |
use Path::Class qw/dir/; | |
my %cache; | |
return sub { | |
my $env = shift; |