Skip to content

Instantly share code, notes, and snippets.

smoke-rebase () {
while true; do
(perl Makefile.PL && make realclean && perl Makefile.PL) &>/dev/null \
&& make -j9 ptest \
&& git rebase --continue \
|| break
done
say All done
}
@dagolden
dagolden / findem.pl
Created July 18, 2015 01:47
Find my dists where latest upload is an alpha
#!/usr/bin/env perl
use v5.14;
use strict;
use warnings;
use CPAN::DistnameInfo;
use HTTP::Tiny;
use Parse::CPAN::Packages::Fast;
my $local_mirror = "/srv/cpan";
# override instead of 'around' to avoid overhead of calling
# the default BUILDARGS
sub BUILDARGS {
my $class = shift;
if ( @_ == 0 ) {
return { value => MongoDB::BSON::generate_oid() };
}
if ( @_ == 1 ) {
if ( ref( $_[0] ) eq 'HASH' ) {
return $_[0];
def getServer(criteria):
startTime = loopEndTime = gettime()
maxTime = startTime + serverSelectionTimeoutMS/1000
if topology.lastUpdateTime - startTime > heartbeatFrequencyMS/1000:
topology.stale = true
while true:
use 5.008001;
use strict;
use warnings;
package Subtest;
# XXX must be used with no_plan or done_testing
use Test::More 0.88;
use base 'Exporter';
Multi-threaded
1. Record the server selection start time
2. If the topology wire version is invalid, raise an error
3. Find suitable servers by topology type and operation type
4. If there are any suitable servers, choose one at random from those
within the latency window and return it; otherwise, continue to step #5
commit 38d79a190b9f2adf34c2c84c4014f90912f368d9
Author: David Golden <dagolden@cpan.org>
Date: Wed May 20 19:47:03 2015 -0400
encode integers as BSON Int32 if they fit
diff --git a/perl_mongo.c b/perl_mongo.c
index 54833fe..9cc619b 100644
--- a/perl_mongo.c
+++ b/perl_mongo.c
#!/usr/bin/env perl
use v5.10;
use strict;
use warnings;
use Capture::Tiny 'tee';
use Path::Tiny;
die "Usage: $0 <outfile> <errfile> <command ...>\n"
unless @ARGV > 2;
bson/bson-json.c | 1298 -----------------------------
bson/bson-json.h | 73 --
bson/bson.h | 1 -
inc/Module/Install/PRIVATE/Mongo.pm | 4 +-
perl_mongo.c | 1564 ++++++++++++++++-------------------
perl_mongo.h | 121 +--
ppport.h | 704 ++++++++++------
yajl/LICENSE | 13 -
yajl/yajl.c | 175 ----
yajl/yajl_alloc.c | 49 --
cpanm (App::cpanminus) 1.7027 on perl 5.020002 built for darwin-thread-multi-2level
Work directory is /Users/david/.cpanm/work/1431036372.26152
You have make /usr/bin/make
You have LWP 6.13
You have /usr/bin/tar: bsdtar 2.8.3 - libarchive 2.8.3
You have /usr/bin/unzip
Searching Dist::Zilla::Plugin::Test::Version on cpanmetadb ...
--> Working on Dist::Zilla::Plugin::Test::Version
Fetching http://www.cpan.org/authors/id/P/PL/PLICEASE/Dist-Zilla-Plugin-Test-Version-1.00.tar.gz
-> OK