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
\b(?:(?<International>[A-Z]{2}[0-9]{9}[A-Z]{2})|(?<FedEx>[0-9]{4} ?[0-9]{4} ?[0-9]{4} ?(?:[0-9]{3})?)|(?<UPS>(?:(?:(?:1Z)[0-9A-Z]{16})|(?:(?:T)[0-9A-Z]{15}[0-9])|(?:[0-9]{9})|(?:[0-9]{26})))|(?<USPS>(?:(?:(?:93|92|94|95)[0-9]{2} ?[0-9]{4} ?[0-9]{4} ?[0-9]{4} ?[0-9]{4} ?[0-9]{2,4})|(?:(?:70|14|23|03)[0-9]{14})|(?:(?:M0|82) ?[0-9]{3} ?[0-9]{3} ?[0-9]{2})|(?:(?:[A-Z]{2})[0-9]{9}(?:[A-Z]{2})))))\b |
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
// these are just suggestions and examples... | |
const TestableTypes = { | |
"undefined" : "undefined", | |
"null" : "null", | |
"object" : "object", | |
"Object" : "Object", | |
"boolean" : "boolean", | |
"Boolean" : "Boolean", | |
"number" : "number", |
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
<# as a one-liner... because why not. #> | |
git ls-remote --tags https://go.googlesource.com/go | ForEach-Object { if ($_ -imatch ('^\s*(?<Commit>[0-9a-f]+)\s+refs/tags/go(?<Version>\d+\.\d+(?:\.\d+)?)\s*$')) { [PSCustomObject]@{Commit=$matches.Commit;Version=[Version]$matches.Version} } } | Sort-Object -Property Version -Descending -Top 1 |
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
#!/bin/bash | |
ID="$1" | |
MAC=$(grep -Ei '^[A-Z0-9]+$' <<<"$ID") | |
if [ -z "$MAC" ]; then | |
MAC=$(/etc/asterisk/scj/sipmac.sh "$ID") | |
if [ -z "$MAC" ]; then | |
echo "$ID was not found" >&2 |
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
/** | |
* @param {any[]} input | |
* @param {Object} filter | |
* @param {(RegExp|string)} filter.match | |
* @param {(string|string[])} filter.property | |
* @param {boolean} [filter.regularExpression=false] | |
* @param {boolean} [filter.caseSensitive=false] | |
* @param {boolean} [filter.multiline=false] | |
*/ | |
function filterArray(input, filter) { |
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
function Find-EmptyFolders { | |
Param( | |
[string]$Path = $pwd, | |
[int]$MaxDepth = 0, | |
[switch]$IgnoreAccessDenied, | |
[switch]$IncludeHidden, | |
[System.Management.Automation.FlagsExpression`1[System.IO.FileAttributes]]$FileAttributes | |
) | |
$getParams = @{ |
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
$documentsFolderPath = $([Environment]::GetFolderPath('Personal')) | |
# other ENUM values are here: | |
# https://learn.microsoft.com/en-us/dotnet/api/system.environment.specialfolder |
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
// JSDoc for Google Apps Script doGet/doPost | |
/** | |
* @param {object} e | |
* @param {string|null} e.queryString - The value of the query string portion of the URL, or `null` if no query string is specified | |
* @param {Object.<string,string>} e.parameter - An object of key/value pairs that correspond to the request parameters. Only the first value is returned for parameters that have multiple values. | |
* @param {Object.<string,string[]>} e.parameters - An object similar to `e.parameter`, but with an array of values for each key | |
* @param {number} e.contentLength - The length of the request body for POST requests, or -1 for GET requests | |
* @param {object} e.postData - An object constructed from the POST body of POST requests, or `null` for GET requests | |
* @param {number} e.postData.length - The same as `e.contentLength` |
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
<# NextDNS install as DNS-over-DOH #> | |
param ( | |
[Parameter( | |
Mandatory = $true, | |
ParameterSetName = "NextDnsId", | |
ValueFromPipeline = $true, | |
ValueFromPipelineByPropertyName = $true, | |
HelpMessage = "NextDNS Configuration ID, like: 12ab3c" | |
)] |