This file contains hidden or 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
0600 (.rw-------) -> 0700 (.rwx------) | |
0755 (.rwxr-xr-x) -> 0755 (.rwxr-xr-x) | |
0660 (.rw-rw----) -> 0770 (.rwxrwx---) | |
0664 (.rw-rw-r--) -> 0775 (.rwxrwxr-x) | |
0666 (.rw-rw-rw-) -> 0777 (.rwxrwxrwx) | |
0622 (.rw--w--w-) -> 0733 (.rwx-wx-wx) | |
0777 (.rwxrwxrwx) -> 0777 (.rwxrwxrwx) |
This file contains hidden or 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 "3.1"; | |
declare function local:safe-effective-boolean-value-if ( | |
$result as item()* | |
) as xs:boolean { | |
try { | |
if ($result) | |
then true() | |
else false() | |
} catch err:FORG0006 { |
This file contains hidden or 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
<main class="news-list__latest"> | |
<ul> | |
<li data-template="templates:each" data-template-from="articles" data-template-to="article"> | |
<a data-template="pr:article-link"/> | |
</li> | |
</ul> | |
</main> |
This file contains hidden or 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 "3.1"; | |
import module namespace semver = "http://exist-db.org/xquery/semver"; | |
declare namespace http="http://expath.org/ns/http-client"; | |
declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization"; | |
declare option output:method "json"; | |
declare option output:media-type "application/json"; |
This file contains hidden or 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 function local:flatten-one($nested as array(*)) as array(*) { | |
array:fold-left($nested, [], function ($flattened as array(*), $next as item()*) as array(*) { | |
typeswitch($next) | |
case array(*) return array:join(($flattened, $next)) | |
default return array:append($flattened, $next) | |
}) | |
}; | |
local:flatten-one([[1], 3, map{}, [1, [3,4]], ()]) |
This file contains hidden or 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
let tx = document.getElementById("text-input") | |
let h = 2 | |
let state = Array(24).fill([h, '_']) | |
let c = ['/', '_', '\\'] | |
let interval | |
function step () { | |
let direction = Math.floor(Math.random() * 2.9999) - 1 | |
let d = Math.min(3, Math.max(0, h+direction)) | |
state.shift() |
This file contains hidden or 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 "3.1"; | |
import module namespace sm="http://exist-db.org/xquery/securitymanager"; | |
import module namespace xmldb="http://exist-db.org/xquery/xmldb"; | |
(: these variables need to be set by the caller :) | |
declare variable $collection as xs:string external; | |
declare variable $group as xs:string? external; | |
declare variable $user as xs:string? external; | |
declare variable $mode as xs:string external; |
This file contains hidden or 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 "3.1"; | |
(: | |
: Parts of gist were taken from by https://mathling.com/code/art/core/utilities.xqy | |
: Copyright Mary Holstege 2020-2021 | |
: Licensed under CC-BY (https://creativecommons.org/licenses/by/4.0/) | |
: | |
: Parts are from the xbow library https://github.com/line-o/xbow | |
: by Juri Leino | |
: Licensed under MIT |
This file contains hidden or 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 "3.1"; | |
(: | |
two possible solutions to @cassidoo's interview question from: | |
https://buttondown.email/cassidoo/archive/it-is-absolutely-imperative-that-every-human/ | |
:) | |
declare function local:product ($result, $next) { $result * $next }; | |
declare function local:grouping ($a, $b, $c) { | |
let $grouped := |
This file contains hidden or 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
(: thanks to Reece H. Dunn for hinting at the fn:path function :) | |
//node()!(.,@*)!path() |