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"; | |
let $img := doc("/binaries/12250.png") | |
let $ct := xdmp:uri-content-type(xdmp:node-uri($img/node())) | |
return <img src="{concat('data:', $ct, ';', 'base64,', xs:base64Binary($img/node()))}"/> |
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 | |
# Bootstraps a REST interface for a database | |
# Customize database, host, port and authentication to fit your environment | |
DB="test-hdfs" | |
HOST="localhost" | |
PORT="8010" | |
AUTH="admin:admin" |
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
declare namespace local="local"; | |
declare function local:random() as xs:double { | |
xdmp:random(10000) div 10000 | |
}; | |
(: http://www.exceluser.com/explore/statsnormal.htm :) | |
declare function local:box-muller() as xs:double { | |
math:sqrt(-2 * math:log(local:random())) * | |
math:sin(2 * math:pi() * local:random()) | |
}; |
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
awk 'NR % 2 == 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
alias json="python -mjson.tool" | |
alias xml="xmllint --format --encode utf-8 -" |
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 | |
# Script to bootstrap an instance of timbrrr with actual data. | |
# Author: Justin Makeig <[email protected]> | |
# Assumptions: | |
# - UNIX and bash. This should also be possible for Windows, but the syntax might be slightly different | |
# - Ports 9001 is available for an HTTP app server and 9002 is available for an XDBC server | |
# - mlcp is downloaded and installed at $MLCPPATH below |
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
function sel(name, val, $) {Array.prototype.slice.call($("select[name="+name+"]").options).forEach(function(opt) {if(opt.value === val) opt.selected = true;})}; sel("status", "will not fix", $); sel("new-fix-in-version", "", $); |
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
perl -pe '1 while s/\G {2}/*/gc' | perl -pe 's/^(.)/*\1/' | perl -pe 's/^(\*+)/\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
tell application "Microsoft Word" | |
activate | |
tell selection | |
set myText to content of text object | |
end tell | |
end tell | |
tell application "System Events" | |
-- Fork it to another process so it doesn't prevent you from doing other stuff in the foreground in Word | |
do shell script "echo " & myText & " | say > /dev/null 2>&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
xquery version "1.0-ml"; | |
distinct-values( | |
cts:search(collection(), cts:and-query(()), ("unfiltered","score-random"))[1 to 100] | |
//*[matches(local-name(.), "Address$")]/xdmp:path(.) | |
) |
OlderNewer