Skip to content

Instantly share code, notes, and snippets.

@ImkeF
ImkeF / Uri.UnescapeDataString.pq
Created August 1, 2023 20:51
Decodes special characters in the input data according to the rules of RFC 3986.
let func =
(data as text) as text =>
let
DecodedText = Uri.Parts("http://contoso?a=" & data)[Query][a]
in
DecodedText ,
documentation = [
Documentation.Name = " Uri.UnescapeDataString ",
Documentation.Description = " Decodes special characters in the input data according to the rules of RFC 3986. ",
Documentation.LongDescription = " Decodes special characters in the input data according to the rules of RFC 3986. ",
@TinyToons
TinyToons / Text.CreateEmptyTableFromSchema.pq
Last active August 2, 2023 21:03 — forked from ImkeF/Text.CreateEmptyTableFromSchema.pq
Creates the M-code for an empty table based on a table schema (Table.Schema).
let
fnFormatted = let
func = (myTable as table) =>
let
#"Table1 Schema" = Table.Schema(myTable),
TypesList = Table.AddColumn(
#"Table1 Schema",
"TypeRecord",
each "#""" & [Name] & """=" & [TypeName]
)[TypeRecord],
@jstangroome
jstangroome / New-XmlNamespaceManager.ps1
Created April 12, 2012 00:30
Create an XmlNamespaceManager pre-populated with an XML document's namespace prefixes to simplify XPath queries
<#
.DESCRIPTION
Create an XmlNamespaceManager pre-populated with an XML document's namespace prefixes to simplify XPath queries
.PARAMETER XmlDocument
An instance of [xml] with custom namespaces to register in the XmlNamespaceManager.
.PARAMETER DefaultNamespacePrefix
Optional prefix to use for the default namespace in XPath queries.