Skip to content

Instantly share code, notes, and snippets.

@shibayu36
shibayu36 / TechTalks.pm
Created July 16, 2013 13:07
Kyoto.pm event template sample
package Dist::Maker::Template::Kyotopm::TechTalks;
use utf8;
use Mouse;
use MouseX::StrictConstructor;
use Dist::Maker::Util qw(run_command);
extends 'Dist::Maker::Base';
with 'Dist::Maker::Template';
# app.psgi
use strict;
use warnings;
use WAF;
any '/' => sub {
my $c = shift;
$c->render('index.tt', { name => 'shiba_yu36' });
};
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Web::Query;
use Perl6::Say;
use List::MoreUtils qw(any);
my $base_url = "http://shibayu36.hatenablog.com";
@shibayu36
shibayu36 / jquery-resizable.html
Created December 6, 2012 03:12
jquery resizable keeping aspect ratio
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>jQuery Resizable</title>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/base/jquery-ui.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.min.js"></script>
<script src="./jquery-resizable.js"></script>
</head>
my $booklist = qq[レベル7||450
さまよう刃|100|250
夜は短し歩けよ乙女|258|200
彼女と僕の伝奇的学問|368
彼女は存在しない||500
レイクサイド|105|150
モダンタイムス(上)|368|250
モダンタイムス(下)|368|250
浜村渚の計算ノート||350
ゼロ、ハチ、ゼロ、ナナ。||651
use strict;
use warnings;
use POSIX;
use Net::OpenSSH;
use AnyEvent;
use AnyEvent::Handle;
my $conn = Net::OpenSSH->new(
'host.h', user => 'hoge',
@shibayu36
shibayu36 / archive-any-lite-eg.pl
Created June 20, 2012 05:13
Archive::Any::Liteを試した
#!perl
use strict;
use warnings;
use Archive::Any::Lite;
my $d = '/path/to/dir';
use Path::Class;
#!perl
use strict;
use warnings;
my $pid = fork;
if ($pid) {
warn 'parent';
wait();
warn $? / 256;
#!perl
use strict;
use warnings;
my $pid = fork;
die "Cannot fork: $!" unless defined $pid;
if ($pid) {
warn "pid:$$ is a parent process(child pid is $pid)";
die;
#!perl
use strict;
use warnings;
my $pid = fork;
die "Cannot fork: $!" unless defined $pid;
if ($pid) {
warn "pid:$$ is a parent process(child pid is $pid)";
wait;