<< Previous | Home

Encoding SVGs for Favicons with XQuery

for $svgurl in (
    "https://www.svgrepo.com/download/530579/set-up.svg",
    "https://www.svgrepo.com/download/296284/cogwheel-setup.svg",
    "https://www.svgrepo.com/download/296276/industrial-robot-robot.svg"
)
return
    encode-for-uri(serialize(doc($svgurl)/*:svg))
Tags : ,
Social Bookmarks :  Add this post to Slashdot    Add this post to Digg    Add this post to Reddit    Add this post to Delicious    Add this post to Stumble it    Add this post to Google    Add this post to Technorati    Add this post to Bloglines    Add this post to Facebook    Add this post to Furl    Add this post to Windows Live    Add this post to Yahoo!

Export this post as PDF document  Export this post to PDF document

PowerShell History File

The default location for the Windows PowerShell history file is...

C:\Users\USERNAME\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt

 

Social Bookmarks :  Add this post to Slashdot    Add this post to Digg    Add this post to Reddit    Add this post to Delicious    Add this post to Stumble it    Add this post to Google    Add this post to Technorati    Add this post to Bloglines    Add this post to Facebook    Add this post to Furl    Add this post to Windows Live    Add this post to Yahoo!

Export this post as PDF document  Export this post to PDF document

Moving files in MarkLogic

xquery version "1.0-ml";

(:
https://developer.marklogic.com/recipe/move-a-document/
:)
declare function local:renameFile($uri as xs:string, $new as xs:string) {
    xdmp:log($uri || " => " || $new),
    let $lock := ($uri, $new) ! xdmp:lock-for-update(.)
    let $prop-ns := fn:namespace-uri-from-QName(xs:QName("prop:properties"))
    let $properties :=
      xdmp:document-properties($uri)/node()/node()
        [ fn:namespace-uri(.) ne $prop-ns ]
    return (
      xdmp:document-insert(
        $new,
        fn:doc($uri),
        xdmp:document-get-permissions($uri),
        xdmp:document-get-collections($uri)
      ),
      xdmp:document-delete($uri),
      xdmp:document-set-properties($new, $properties)
    )
};

for $uri as xs:string in cts:uri-match("directory-in-marklogic/*.xml")
let $new as xs:string := "/" || $uri
return 
    local:renameFile($uri, $new)
Social Bookmarks :  Add this post to Slashdot    Add this post to Digg    Add this post to Reddit    Add this post to Delicious    Add this post to Stumble it    Add this post to Google    Add this post to Technorati    Add this post to Bloglines    Add this post to Facebook    Add this post to Furl    Add this post to Windows Live    Add this post to Yahoo!

Export this post as PDF document  Export this post to PDF document

Hashing Files with sha256

Windows:

certutil -hashfile C:\path\to\file.exe SHA256

MarkLogic:

let $binary as binary() := xdmp:document-get("C:\path\to\file.exe")/binary()
return
    xdmp:sha256($binary)
Social Bookmarks :  Add this post to Slashdot    Add this post to Digg    Add this post to Reddit    Add this post to Delicious    Add this post to Stumble it    Add this post to Google    Add this post to Technorati    Add this post to Bloglines    Add this post to Facebook    Add this post to Furl    Add this post to Windows Live    Add this post to Yahoo!

Export this post as PDF document  Export this post to PDF document