Skip to content

Instantly share code, notes, and snippets.

Joe Wicentowski joewiz

Block or report user

Report or block joewiz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jamescummings
jamescummings / tei_minimal-new.odd
Created Jun 23, 2019
A proposed new tei_minimal.odd which really is minimal
View tei_minimal-new.odd
<?xml version="1.0" encoding="UTF-8"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0">
<teiHeader>
<fileDesc>
<titleStmt>
<title>TEI Minimal</title>
<author>James Cummings</author>
</titleStmt>
<publicationStmt>
<publisher>TEI Consortium</publisher>
@line-o
line-o / example.xq
Last active Jun 19, 2019
xquery implementation to format dateTime in Internet Message Format
View example.xq
xquery version "3.1";
import module namespace imfd='http://existsolutions.com/apps/imfd' at '/db/temp/imfd.xqm';
let $now := current-dateTime()
let $tz := timezone-from-dateTime($now)
let $imfd := imfd:format($now)
let $gmt := imfd:to-dateTime($imfd)
let $reversed := adjust-dateTime-to-timezone($gmt + $tz, $tz)
@adamretter
adamretter / dtx.xqm
Created Mar 28, 2019
Date/Time/DateTime XQuery functions
View dtx.xqm
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;
@grantmacken
grantmacken / .env
Last active Feb 19, 2019
Use prove to get TAP output from running #existdb unit tests
View .env
NAME=newBase60
CONTAINER=exDev
PORT=8282
USE_DC_OVERRIDE=yes
DC_OVERRIDE_NETWORK=www
@xquery
xquery / topo.xqy
Created Feb 8, 2019
example topo sort in xquery
View topo.xqy
declare function local:topo-sort($unsorted, $sorted ) {
if (empty($unsorted)) then $sorted
else
let $allnodes := $unsorted [ every $id in depends/@id satisfies $id = $sorted/@id]
return
if ($allnodes) then
local:topo-sort( $unsorted except $allnodes, ($sorted, $allnodes ))
else ()
};
View data-composition.xqy
xquery version "3.0";
(: the power of algebraic data types in xquery
This example shows how we can composite up data models
which 'carry' their own operations along with them.
:)
(: using John Snelson's inspirational https://github.com/jpcs/data.xq :)
@adamretter
adamretter / exist-message-digest-algs.txt
Last active Nov 13, 2018
MessageDigest algorithms offered by eXist-db
View exist-message-digest-algs.txt
PROVIDER | ALGORITHM
-----------|------------
SUN
MD2
MD5
SHA
SHA-224
SHA-256
SHA-384
SHA-512
@line-o
line-o / pw-reset.xq
Last active Nov 8, 2018
Rough sketch of a password reset for eXist-db
View pw-reset.xq
xquery version '3.1';
(:~
this script must be run with a user in the DBA group
add this line to your post-install script or run it manually
it will set the GID sticky bit
chown('/path/to/this/script.xq', 'admin', 'dba')
chmod('/path/to/this/script.xq', 'rwxr-S---')
:)
@wsalesky
wsalesky / git-commit.xql
Created Oct 12, 2018
XQuery to commit content to GitHub. Query creates a new branch, commits content and creates a new pull request to specified repository.
View git-commit.xql
xquery version "3.1";
(:~
: POC: XQuery to commit content to github reop via github API. Tested in eXist-db v4.4.0
: Code creates a new branch off of the master branch, commits updated content to the new branch
: and then submits a pull request when complete. Intended use is for online data submission,
: using GitHub for review/approval process.
:
: Prerequisites:
: In order to run the module, you will need a github Authorization token.
@dizzzz
dizzzz / duplicates_in_sequence.xq
Last active Sep 4, 2018
xquery find duplicates in sequence
View duplicates_in_sequence.xq
(: wolfgang :)
for $i in (1, 5, 2, 4, 5)
group by $j := $i
return
    $j || ": " || count($i)
(: adam :)
let $seq := (1, 5, 2, 4, 5)
return
    distinct-values(
You can’t perform that action at this time.