This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools | |
test1 = [ | |
('3df947df42a13686382b47a73ca12b2fe535f5a3', ''), | |
('1d6018219ba9eaeb209f31e91b7d56b77d4fbfc3', 'passed'), | |
('7295f7c3606109789228ab48c23a7807ec8a3f61', ''), | |
('ba39eb2f561ef668f0569c57a8ee0e549b05049c', ''), | |
('f845f3fe4e45e9137da68b45ef43e0611659f4ab', ''), | |
('ef7e74c7d89faec970e7cae961fd58e45cb69175', ''), | |
('77255a3aa08d493252d1fb3e2c19967bf4253a59', 'passed'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0-ml"; | |
declare namespace p = "http://ns.webservices.bbc.co.uk/2006/02/pips"; | |
declare namespace n = "http://www.bbc.co.uk/nitro/"; | |
declare namespace nm = "http://www.bbc.co.uk/nitro/meta"; | |
import module namespace mem = "http://xqdev.com/in-mem-update" at "/MarkLogic/appservices/utils/in-mem-update.xqy"; | |
declare function local:tokenize($item) as xs:string* { | |
typeswitch($item) | |
case text() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FIFO=$(mktemp /tmp/multicurl.XXXXX) | |
echo FIFO=$FIFO | |
for arg in "$@" | |
do | |
curl $arg > $FIFO & | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use IO::Select; | |
my %handle_names; | |
my $s = IO::Select->new; | |
for my $url (@ARGV) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro curry [fname fixed-args & body] | |
(let [arg-count (count fixed-args)] | |
`(defn ~fname [& ~'args] | |
(cond | |
(< (count ~'args) ~arg-count) | |
(apply partial (concat [~fname] ~'args)) | |
:else | |
(let [~fixed-args ~'args] | |
~@body))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(deftask build-deps | |
"Build a deps JAR." | |
[d dir PATH #{str} "the set of directories to write to (target)."] | |
(set-env! :resource-paths #{} | |
:source-paths #{}) | |
(task-options! jar #(assoc % :file "epg-ingester-deps.jar" :main nil)) | |
(let [dir (if (seq dir) dir #{"target"})] | |
(comp (test) (aot) (pom) (uber) (jar) (target :dir dir)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
boot.user=> (defn and->> [f value] (doto value f)) | |
#'boot.user/and->> | |
boot.user=> (defn and-> [value f] (doto value f)) | |
#'boot.user/and-> | |
;; use the appropriate and->(>) form for your threading macro | |
boot.user=> (-> 1 (and-> println)) | |
1 | |
1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use File::Spec; | |
my $in = 'in'; | |
my $out = 'out'; | |
sub process { | |
my ($in, $out, $callback) = @_; | |
opendir (my $DIR, $in) or die "Failed to open dir $in: $!"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#### | |
# Split MySQL dump SQL file into one file per table | |
# based on http://blog.tty.nl/2011/12/28/splitting-a-database-dump | |
# from https://gist.github.com/jasny/1608062 | |
#### | |
if [ $# -lt 1 ] ; then | |
echo "USAGE $0 DUMP_FILE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; use warnings; | |
use XML::LibXML; | |
use XML::LibXML::XPathContext; | |
my $xml = <<'__EOI__'; | |
<par xmlns:bar="www.bar.com"><bar:foo/></par> | |
__EOI__ | |
my $parser = XML::LibXML->new(); |
OlderNewer