Skip to content

Instantly share code, notes, and snippets.

View Songmu's full-sized avatar

Masayuki Matsuki Songmu

View GitHub Profile
App::Ack :19
YAML :19
Devel::NYTProf :18
Perl::Tidy :18
App::cpanminus :17
Dist::Zilla :17
Moose :17
Test::Pod :16
JSON :15
DBD::SQLite :14
function peco-src () {
local selected_dir=$(ghq list --full-path | perl -pe 's/(\Q$ENV{HOME}\E(.*$))/$2\0$1/' | peco --null --query "$LBUFFER")
if [ -n "$selected_dir" ]; then
BUFFER="cd ${selected_dir}"
zle accept-line
fi
zle clear-screen
}
#!/bin/sh
# 開発用にプロジェクト用のperlをbuildするやつです
set -e
cd $(dirname $0)
MYPROJ_PERL='perl518-myproj'
@Songmu
Songmu / plenvsetup
Last active August 29, 2015 14:01 — forked from ytnobody/plenvsetup
#!/bin/sh
# plenvを自動的に入れてくれるやつです
set -e
if [[ $(which plenv 2> /dev/null) ]]; then
echo 'plenv already installed.'
elif [[ ! $(which git) ]]; then
echo 'git is not installed!!!!!!!'
exit 1;
#!/usr/bin/env perl
use 5.012;
use strict;
use warnings;
use List::Util qw/pairmap pairkeys/;
use Benchmark qw(:all);
bench($_) for qw(100);
use OrePAN2::Injector;
use OrePAN2::Indexer;
use Plack::Request;
use File::Copy qw/move/;
use File::Temp qw/tempdir/;
use File::Spec;
sub {
my $env = shift;
my $req = Plack::Request->new($env);
subtest 'posting' => sub {
my $psgi = Plack::Test->create($app);
my $req = POST '/', [ name => 'alice', type => 1 ];
my $autodoc = AutoDoc->new;
$autodoc->description('creates a new recipe');
$autodoc->rule(
name => { isa => 'Str' },
type => { isa => 'Int', default => 1 },
);
@Songmu
Songmu / ore_carton.pl
Last active December 25, 2015 13:39
上手く動かない君
#!/usr/bin/env perl
use 5.016;
use strict;
use warnings;
use utf8;
use autodie;
use File::Path qw/mkpath/;
use Carton::CLI;
use Module::Metadata;
#!/usr/bin/env perl
use 5.016;
use warnings;
use utf8;
use autodie;
use Net::OpenSSH;
use Path::Tiny qw/path/;
use Term::ANSIColor qw/colored/;
use Text::Diff qw/diff/;
[Songmu]$ perl -MDBI -E 'for my $key (@{DBI::EXPORT_TAGS->{sql_types}} ) { printf "%35s : %s\n", $key, DBI->can($key)->(); }'
SQL_GUID : -11
SQL_WLONGVARCHAR : -10
SQL_WVARCHAR : -9
SQL_WCHAR : -8
SQL_BIGINT : -5
SQL_BIT : -7
SQL_TINYINT : -6
SQL_LONGVARBINARY : -4
SQL_VARBINARY : -3