Skip to content

Instantly share code, notes, and snippets.

View Songmu's full-sized avatar

Masayuki Matsuki Songmu

View GitHub Profile
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use 5.12.0;
use Path::Class;
use Getopt::Long;
use Pod::Usage;
@Songmu
Songmu / td-agetnt.sh
Created March 6, 2012 09:16 — forked from kaz29/td-agetnt.sh
td-agent setup for NiftyCloud - CentOS 5.6 64bit Plain
#!/bin/sh
# apache,fluent-plugin-s2が依存するパッケージをインストール
yum -y install httpd.x86_64 \
libxml2-devel.x86_64 libxslt-devel.x86_64
# td-agent 用のリポジトリを登録
cat <<_EOT_ 1>/etc/yum.repos.d/td.repo
[treasuredata]
name=TreasureData
#!/usr/bin/env perl
use 5.12.0;
use warnings;
use utf8;
use YAML;
use List::Util qw/shuffle/;
my $arr = [1..50];
my $split_unit = 10;
if (
長い条件 ||
長い条件
){
...
}
@Songmu
Songmu / md_preview.pl
Created September 1, 2012 18:41
md_preview
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
=head1 SYNOPSIS
% md_preview.pl markdown.md
=cut
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.github.mxcl.homebrew.daemontools</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/svscanboot</string>
</array>
@Songmu
Songmu / spork_watcher.pl
Created October 9, 2012 02:15
sporkの更新検知して自動でスライド作ってくれる君
#!/usr/bin/env perl
use strict;
use warnings;
use Filesys::Notify::Simple;
use Spork;
my $watcher = Filesys::Notify::Simple->new(['./Spork.slides']);
my $spork_command = Spork->new->load_hub->command;
while (1) {
$watcher->wait(sub {
has num => (is => 'rw', isa => 'Int', required => 1, trigger => sub {shift->clear_all} );
has double => (is => 'rw', isa => 'Int', default => sub { shift->num * 2 }, clearer => 'clear_all');
has triple => (is => 'rw', isa => 'Int', default => sub { shift->num * 3 }, clearer => 'clear_all');
#!/usr/bin/env perl
use 5.014;
use warnings;
use utf8;
use autodie;
use common::sense;
use LWP::Simple ();
use Web::Query;
use YAML;
@Songmu
Songmu / MyApp::DB.pm
Last active December 14, 2015 12:29
Tengの最近の雛形
package MyApp::DB;
use 5.016;
use warnings;
use utf8;
use Time::Piece::Plus;
use Class::Method::Modifiers;
use Teng::Schema::Loader;
use MyApp::DB::ResultSet;
use MyApp::Exception;