Skip to content

Instantly share code, notes, and snippets.

{
"query": {
"match_all": {}
},
"filter": {
"and": [
{
"term": {
"path": "cpanfile"
}
@timbunce
timbunce / keybase.md
Created October 30, 2014 22:02
keybase.md

Keybase proof

I hereby claim:

  • I am timbunce on github.
  • I am timbunce (https://keybase.io/timbunce) on keybase.
  • I have a public key whose fingerprint is 27B2 2751 AF56 A665 AE9E 93E2 356E FE07 F4AD 7187

To claim this, I am signing this object:

@timbunce
timbunce / gist:085f810cc7ce24d7b6e9
Created February 17, 2015 23:50
DBIx::RetryConnection to add DBI connection retry logic
Typical usage:
use DBIx::RetryConnection qw(Pg);
or:
use DBIx::RetryConnection Pg => { ... }; # options for Type::Tiny::Retry
DBI->connect('dbi:Pg:...', $user, $pass, { private_dbix_retry_connection_delay_exp => [...] });
role R {
method m() { say 42 }
}
class C does R {
}
my $x = C.new;
log-calls($x, R);
@timbunce
timbunce / gist:591718
Created September 22, 2010 14:00
perl 6 method wrapping via a role
role R {
method m() { say 42 }
}
class C does R {
}
my $x = C.new;
log-calls($x, R);
@timbunce
timbunce / smzp_sinopsys.md
Created August 1, 2012 14:22 — forked from melo/smzp_sinopsys.md
mzp synopsis

mpz synopsis

mpz is a ZeroMQ-based pipe.

It will read stuff from STDIN and output to ZeroMQ sockets, and read from ZeroMQ sockets and send to STDOUT.

Messages are terminated by newlines, or pairs of newlines in paragraph mode.

Supports 1-to-1, 1-to-N and N-to-1. There is a special mode to start as

@xyz»++ # increment all elements of @xyz
@x = @a »min« @b # @x is smallest of @a and @b
$mean = ([+] @a) / @a # calculate mean of @a
$sumsq = [+] (@x »**» 2) # sum of squares of @x
$fact = [*] 1..$n # $n factorial
@timbunce
timbunce / pr.md
Created April 1, 2013 09:25 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@timbunce
timbunce / gist:5514563
Created May 3, 2013 22:07
warn("%p %s\n", basecop->cop_file, basecop->cop_file); while traversing the op tree of blib::import
600c00020180 /usr/local/perl5-blead-deb-thr-asan/lib/5.17.11/blib.pm
600c00020360 /usr/local/perl5-blead-deb-thr-asan/lib/5.17.11/blib.pm
600c000204e0 /usr/local/perl5-blead-deb-thr-asan/lib/5.17.11/blib.pm
600c00020540 /usr/local/perl5-blead-deb-thr-asan/lib/5.17.11/blib.pm
600c000205a0 /usr/local/perl5-blead-deb-thr-asan/lib/5.17.11/blib.pm
600c00020480 /usr/local/perl5-blead-deb-thr-asan/lib/5.17.11/blib.pm
600c00020600 /usr/local/perl5-blead-deb-thr-asan/lib/5.17.11/blib.pm
600c000206c0 /usr/local/perl5-blead-deb-thr-asan/lib/5.17.11/blib.pm
600c00020780 /usr/local/perl5-blead-deb-thr-asan/lib/5.17.11/blib.pm
600c00020300 /usr/local/perl5-blead-deb-thr-asan/lib/5.17.11/blib.pm
@timbunce
timbunce / perl -V
Created May 3, 2013 22:12
warn("%p %s\n", basecop->cop_file, basecop->cop_file);
600c00020180 /usr/local/perl5-blead-deb-thr-asan/lib/5.17.11/blib.pm
600c00020360 /usr/local/perl5-blead-deb-thr-asan/lib/5.17.11/blib.pm
600c000204e0 /usr/local/perl5-blead-deb-thr-asan/lib/5.17.11/blib.pm
600c00020540 /usr/local/perl5-blead-deb-thr-asan/lib/5.17.11/blib.pm
600c000205a0 /usr/local/perl5-blead-deb-thr-asan/lib/5.17.11/blib.pm
600c00020480 /usr/local/perl5-blead-deb-thr-asan/lib/5.17.11/blib.pm
600c00020600 /usr/local/perl5-blead-deb-thr-asan/lib/5.17.11/blib.pm
600c000206c0 /usr/local/perl5-blead-deb-thr-asan/lib/5.17.11/blib.pm
600c00020780 /usr/local/perl5-blead-deb-thr-asan/lib/5.17.11/blib.pm
600c00020300 /usr/local/perl5-blead-deb-thr-asan/lib/5.17.11/blib.pm