Skip to content

Instantly share code, notes, and snippets.

@holmesw
holmesw / file-csv-report.md
Created June 11, 2024 18:21
PowerShell Script to Generate a CSV Report of all Files in Directory (including subdirectories) That Were Created/Last Modified Over 6 Years Ago

PowerShell Script to Generate a CSV Report of Old Files

This PowerShell script generates a CSV report of all files in a specified directory (including subdirectories) that were created or last modified over 6 years ago. The report is saved to a specified location.

Script Description

Variables

  • $rootDirectory: Defines the root directory to search for files.
  • $outputCsv: Defines the output CSV file path where the report will be saved.
@holmesw
holmesw / update-file-date-properties.md
Created June 8, 2024 17:59
PowerShell Script to Update File Date Properties

PowerShell Script to Update File Date Properties

This PowerShell script updates the creation and last modified dates of files in a specified directory (including subdirectories) that were created or modified over 6 years ago. The script sets the new creation date to 1 year ago and the new last modified date to 1 minute after the new creation date.

Script Description

Variables

  • $rootDirectory: Defines the root directory to search for files.
  • $currentDate: Stores the current date and time.
@holmesw
holmesw / find-docs-with-missing-element.xqy
Created September 7, 2023 18:49
Find XML Documents Missing an Element Using cts:search
xquery version "3.0";
declare namespace employee =
"http://example.com/employee";
declare namespace xdmp =
"http://marklogic.com/xdmp";
declare namespace cts =
"http://marklogic.com/cts";
@holmesw
holmesw / clone-ml-app-server.md
Last active July 27, 2024 09:11
Clone a MarkLogic App Server

Clone An ML App Server in XQuery 3.1

This XQuery script is designed to clone an existing server in MarkLogic. If the new server already exists, it returns the name of the new server. Otherwise, it creates a new server and returns the configuration.

Version

  • Version: 1.0
  • Since: 2024-03-26
  • XQuery Version: 3.1

Namespaces

@holmesw
holmesw / xml-london-2017.bib
Created June 10, 2017 11:34
XML London 2017 bibtex
@INPROCEEDINGS {XMLLondon17.Lockett01,
title = "Distributing XSLT Processing between Client and Server",
author = "O'Neil Delpratt and Debbie Lockett",
crossref = "ISBN:9780992647148",
pages = "8-18",
booktitle = "XML London 2017 Conference Proceedings",
year = "2017",
doi = "10.14337/XMLLondon17.Lockett01",
url = "http://dx.doi.org/10.14337/XMLLondon17.Lockett01",
keywords = "xml,xmllondon,xmllondon17,xmllondon2017,XSLT,Client,Server",
@holmesw
holmesw / csv.md
Last active April 1, 2024 20:43
XQuery 3.0 and XSLT 2.0 Library with functions to output data as CSV

XQuery and XSLT CSV Library

This XQuery 3.0 library module provides functions to output data in CSV format. CSV (Comma-Separated Values) is a common format for tabular data.

Overview

@holmesw
holmesw / xml-london-2014.bib
Created June 6, 2016 12:02
XML London 2014 Conference Proceedings bibtex
@INPROCEEDINGS {XMLLondon14.Kay01,
title = "Benchmarking XSLT Performance",
author = "Michael Kay and Debbie Lockett",
crossref = "ISBN:9780992647117",
pages = "10—23",
booktitle = "XML London 2014 Conference Proceedings",
year = "2014",
doi = "10.14337/XMLLondon14.Kay01",
url = "http://dx.doi.org/10.14337/XMLLondon14.Kay01",
keywords = "xmllondon,xmllondon14,xmllondon2014,XT-Speedo,Benchmarking,XSLT,Performance",
@holmesw
holmesw / xml-london-2016.bib
Created June 5, 2016 14:08
XML London 2016 Conference Proceedings bibtex
@INPROCEEDINGS {XMLLondon16.Braaksma01,
title = "Dealing with unlimited XML feeds using XSLT 3.0 streaming",
author = "Abel Braaksma",
crossref = "ISBN:9780992647131",
pages = "6—17",
booktitle = "XML London 2016 Conference Proceedings",
year = "2016",
doi = "10.14337/XMLLondon16.Braaksma01",
url = "http://dx.doi.org/10.14337/XMLLondon16.Braaksma01",
keywords = "xmllondon,xmllondon16,xmllondon2016,XML,XSLT,XPath,Exselt",
@holmesw
holmesw / xml-london-2015.bib
Created June 5, 2016 14:07
XML London 2015 Conference Proceedings bibtex
@INPROCEEDINGS {XMLLondon15.Lumley01,
title = "Improving Pattern Matching Performance in XSLT",
author = "John Lumley and Michael Kay",
crossref = "ISBN:9780992647124",
pages = "9—25",
booktitle = "XML London 2015 Conference Proceedings",
year = "2015",
doi = "10.14337/XMLLondon15.Lumley01",
url = "http://dx.doi.org/10.14337/XMLLondon15.Lumley01",
keywords = "xmllondon,xmllondon15,xmllondon2015,XSLT,Pattern matching",
@holmesw
holmesw / compose.md
Last active March 28, 2024 08:12
Function Composition in XQuery 3.1

Function Composition in XQuery 3.1

Overview

This module provides a compose function.

Namespace

The module and default function namespaces are https://tinyurl.com/9apf36he.

Function: compose