Skip to content

Instantly share code, notes, and snippets.

View dizzzz's full-sized avatar

Dannes Wessels dizzzz

View GitHub Profile
@vincentml
vincentml / exist-db service install.md
Last active December 12, 2022 18:57
eXist-db scripts to install and run eXist-db as a service on Windows operating systems.

eXist-db scripts to install and run eXist-db as a service on Windows operating systems.

These scripts should be placed in the "bin" folder of eXsit-db, for example after downloading and unzipping exist-distribution-6.0.1-win.zip from GitHub.

@adamretter
adamretter / dtx.xqm
Last active January 22, 2020 21:22
Date/Time/DateTime XQuery functions
import module namespace functx = "http://www.functx.com";
(: NOTE -- functx uses 1 to 7 to represent MON-SUN, whereas eXist-db's datetime module used 1 to 7 to represent SUN-SAT :)
declare variable $local:MON := 1;
declare variable $local:TUES := 2;
declare variable $local:WEDS := 3;
declare variable $local:THURS := 4;
declare variable $local:FRI := 5;
declare variable $local:SAT := 6;
@joewiz
joewiz / 01-levenshtein-distance.xq
Last active July 5, 2022 17:18
Calculate Levenshtein Distance, using XQuery
xquery version "3.1";
(:~
Calculate Levenshtein Distance, using XQuery
@author Guillaume Mella
@see http://apps.jmmc.fr/~mellag/xquery/levenshtein/2018/01/19/xquery-levenshtein-distance/
:)
declare function local:levenshtein-distance($string1 as xs:string?, $string2 as xs:string?)
as xs:integer
@joewiz
joewiz / README.md
Last active June 24, 2022 21:08
A report showing function signature mismatches in eXist's implementation of the XPath & XQuery functions & operators spec
@joewiz
joewiz / available-collation-locales.xq
Last active January 17, 2017 17:04
List collation locales (for sorting strings using language-specific rules) available in eXist
xquery version "3.1";
(: List all collation locales available for use in the '?lang=' parameter of a collation URI.
: @see http://exist-db.org/exist/apps/doc/xquery.xml#collations
: @see http://exist-db.org/exist/apps/fundocs/view.html?uri=http://exist-db.org/xquery/util#collations.0
:)
element collations {
for $collation in util:collations()
order by $collation
@joewiz
joewiz / exist-xpath-functions.xq
Last active April 1, 2020 15:18
Compare XPath functions in W3C spec vs. eXist 3.4.0
xquery version "3.1";
element modules {
util:registered-modules()[starts-with(., 'http://www.w3')] !
element module {
element namespace-uri {.},
util:registered-functions(.) !
element function {.}
}
}
@joewiz
joewiz / json-xml.xqm
Last active June 6, 2021 00:33
An implementation of XQuery 3.1's fn:json-to-xml and fn:xml-to-json functions for eXist
xquery version "3.1";
(:~
: An implementation of XQuery 3.1's fn:json-to-xml and fn:xml-to-json functions for eXist, which does not support them natively as of 4.3.0.
:
: @author Joe Wicentowski
: @version 0.4
: @see http://www.w3.org/TR/xpath-functions-31/#json
:)
module namespace jx = "http://joewiz.org/ns/xquery/json-xml";
@wsalesky
wsalesky / git-sync.xql
Last active August 19, 2019 08:58
Sync remote eXistdb with github repository automatically using github webhooks.
xquery version "3.0";
(:module namespace gitsync = "http://syriaca.org/ns/gitsync";:)
(:~
: XQuery endpoint to respond to Github webhook requests. Query responds only to push requests.

: The EXPath Crypto library supplies the HMAC-SHA1 algorithm for matching Github secret. 

:
: Secret can be stored as environmental variable.
: Will need to be run with administrative privileges, suggest creating a git user with privileges only to relevant app.
@joewiz
joewiz / check-links.xq
Created April 21, 2014 13:51
Check a remote webpage for broken links, with XQuery and EXPath HTTP Client
@danfinlay
danfinlay / How to download streaming video.md
Last active June 29, 2024 04:41
How to download a streaming video with Google Chrome

How to download streaming video

Streaming just means a download that they don't want you to keep. But Chrome's developer tools make it easy to access what's really going on under the hood.

Open Developer Tools

From the page where you want to download some things, go into your chrome menu to open the developer tools. You can either:

1.  (On a mac): Command-option-J
2. (On a PC): Control-alt-J