Skip to content

Instantly share code, notes, and snippets.

@tsibley
tsibley / body.json
Last active August 29, 2015 13:57
Example of prefix matching distributions on MetaCPAN
{
"query": { "match_all": {} },
"filter": {
"prefix": { "name": "MooseX-" }
}
}
@tsibley
tsibley / 0000-explode_csv
Last active August 29, 2015 14:01
explode_csv
#!/usr/bin/env perl
use strict;
use warnings;
use Module::Runtime qw< require_module >;
use Text::CSV;
my $filename = $ARGV[0];
my $parser_class = $filename =~ /\.xlsx$/
? "Spreadsheet::ParseXLSX"
@tsibley
tsibley / Makefile
Last active August 29, 2015 14:01
Alternate Makefile to only build and install a select few of the moreutils package
BINS := sponge pee
PERLSCRIPTS := chronic
MANS := $(BINS:=.1) $(PERLSCRIPTS:=.1)
PREFIX := /usr/local
selected := PREFIX=$(PREFIX) BINS="$(BINS)" PERLSCRIPTS="$(PERLSCRIPTS)" MANS="$(MANS)"
all:
make all $(selected)
@tsibley
tsibley / dist-zilla-request.json
Last active August 29, 2015 14:01
Search for "dist zilla" on metacpan
{
"query" : {
"filtered" : {
"query" : {
"custom_score" : {
"query" : {
"boosting" : {
"negative_boost" : 0.5,
"positive" : {
"bool" : {
@tsibley
tsibley / Dist-Zilla-request.json
Created May 25, 2014 20:23
Search for "Dist Zilla" on metacpan — same as "dist zilla" → https://gist.github.com/tsibley/863fc6ae99cd2bce151c
{
"from" : 0,
"facets" : {
"count" : {
"terms" : {
"size" : 999,
"field" : "distribution"
}
}
},
#!/bin/bash
#
# Potentially re-exec commands inside the current directory's carton
# environment.
#
# Usage: alias perldoc='maybe-via-carton perldoc'
#
cmd=$1
shift
if [[ -f cpanfile.snapshot && -d local ]] && which carton >/dev/null 2>/dev/null; then
use strict;
use warnings;
use DDP;
use Bio::Regexp;
use Bio::Tools::IUPAC;
use Bio::PrimarySeq;
my $query = "GTGYCAGCMGCCGCGGTAA";
my $input = "TAACTCCGNGCCAGCAGCCNCGGTAATACGGAGG";
use strict;
use warnings;
use DDP;
use Bio::Regexp;
use Bio::Tools::IUPAC;
use Bio::PrimarySeq;
my $query = "GTGYCAGCMGCCGCGGTAA";
my $input = "TAACTCCGNGCCAGCAGCCNCGGTAATACGGAGG";
use strict;
use warnings;
use DDP;
use Bio::Regexp;
use Bio::Tools::IUPAC;
use Bio::PrimarySeq;
my $query = "GTGYCAGCMGCCGCGGTAA";
my $input = "TAACTCCGNGCCAGCAGCCNCGGTAATACGGAGG";
@tsibley
tsibley / podtogo.pl
Last active August 29, 2015 14:05
podtogo
#!/usr/bin/env plackup
use strict;
use warnings;
use utf8;
use Plack::Builder;
use Plack::App::Directory;
use HTML::Restrict;
use lib::remote