Skip to content

Instantly share code, notes, and snippets.

# via: http://search.cpan.org/~miyagawa/Plack-1.0029/lib/Plack/App/Cascade.pm
use Plack::App::Cascade;
use Plack::App::File;
use Plack::A pp::URLMap;
my $cascade = Plack::App::Cascade->new;
$cascade->add(
Plack::App::File->new(root => '/path/to/dir1')->to_app,
Plack::App::File->new(root => '/path/to/dir2')->to_app,
);
https://github.com/<user_name>/<repo_name>/tarball/<branch_name>
e.g.
https://github.com/issm/p5-Amon2-Plugin-Model/tarball/master
https://github.com/issm/p5-Amon2-Plugin-Model/zipball/master
cpanm -l local https://github.com/<user_name>/<repo_name>/tarball/<branch_name>
e.g.
cpanm -l local https://github.com/issm/p5-Amon2-Plugin-Model/tarball/master
@keisatou
keisatou / useful plackup one liners
Created November 20, 2013 17:39
http://bayashi.net/static/slide/20131120/index.html のコピペです。一覧できるようにメモ。
# see the following site for details: http://bayashi.net/static/slide/20131120/index.html
# 1
$ plackup -e 'sub {
[ 200, [], ["OK"] ]
}'
$ curl http://localhost:5000/
OK
# 2
#
# Server starter
#
# Server::Starter
http://dl.dropboxusercontent.com/u/224433/plackcon/index.html#14
#
# Performance
# http://docs.fluentd.org/articles/free-alternative-to-splunk-by-fluentd
# td-agentを既にbrewで入れてしまったときの手順。
for i in fluent-plugin-elasticsearch fluent-plugin-kibana-server fluent-plugin-embedded-elasticsearch
do
echo $i
done
curl -Ls http://docs.fluentd.org/misc/fluentd-kibana-elasticsearch/fluentd-kibana-elasticsearch.conf > test.conf
* プラグイン検索(いつも忘れるのでメモ)
:h neobundle-unite-source-neobundle-search
:Unite neobundle/search
* Plugin
** Go
https://github.com/Blackrush/vim-gocode
↑本家のお墨付き: https://github.com/nsf/gocode
* Intstruction
https://github.com/Blackrush/vim-gocode
** Workaround for Mac OS X user
https://github.com/Blackrush/vim-gocode/wiki/Installation-on-OS-X
# Building/installing the docker client on OS X: https://groups.google.com/forum/#!msg/docker-user/8m0Eh5nw-1U/J3SGYXqn1OMJ
$ go version
go version go1.2 darwin/amd64
$ go env
GOARCH="amd64"
GOBIN=""
GOCHAR="6"
GOEXE=""
https://github.com/hashicorp/serf/blob/master/Makefile で使われてる以下のgoの文法の意味調べる:
go list -f '{{range .TestImports}}{{.}} {{end}}' ./...
まず-fはフォーマットの指定。詳しくはgo help listを見る。
引数の./...はgo help packagesによると
As a special case, x/... matches x as well as x's subdirectories.
For example, net/... expands to net and packages in its subdirectories.
らしい。