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
. './metadata.ps1' | |
Function Bbcode-Row { | |
Param ([switch]$Heading, $From) | |
Begin { | |
'[tr]' | |
} | |
Process { | |
('[th]','[td]')[!$Heading] | |
if ($From) { |
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
#todo explanation |
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
$dirs='.' | |
Get-ChildItem -Path 'dedupe' | Remove-Item -Recurse | |
$dirs = $dirs | %{ ($_ | Get-Item).FullName } | |
$matchDirs = '^(' + (($dirs | %{ [Regex]::Escape($_) }) -join '|') + ')' | |
$preferences = ( | |
('Act \d{4}( No \d+| \(\d{4} No[. ]\d+\))? - \d{1,2}\.\d{1,2}\.\d{4}\.pdf$', 'Act,( \d{4},?)?( No \d+| \(\d{4} No[. ]\d+\))? - \d{1,2}\.\d{1,2}\.\d{4}\.pdf$' ), | |
('Act \d{4} No \d+ - \d{1,2}\.\d{1,2}\.\d{4}\.pdf$' , 'Act( No \d+)? - \d{1,2}\.\d{1,2}\.\d{4}\.pdf$' ), | |
('Act \d{4} No \d+ - \d{1,2}\.\d{1,2}\.\d{4}\.pdf$' , 'Act,? \d{4},? No\.\d+ - \d{1,2}\.\d{1,2}\.\d{4}\.pdf$' ), |
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
Filter FromRoman { | |
$output = 0 | |
if ($_ -notmatch '^(M{1,3}|)(CM|CD|D?C{0,3}|)(XC|XL|L?X{0,3}|)(IX|IV|V?I{0,3}|)$') { | |
throw 'Incorrect format' | |
} | |
$current = 1000 | |
$subtractor = 'M' | |
$whole = $False |
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
. ./async.ps1 | |
. ./asynclet.ps1 | |
. ./unicode.ps1 | |
. ./windows.ps1 | |
. ./wrap.ps1 | |
$_TABLE_TITLE = 'The powershell window will show progress. You can email or run again by making a selection' | |
$timer = [system.diagnostics.stopwatch]::StartNew() | |
$selection = [Asynclet]::new( | |
'Out-GridView', |
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($hostname, $port) | |
$socket = $NULL | |
$stream = $NULL | |
try { | |
$socket = [System.Net.Sockets.TCPClient]::new( | |
[System.Net.IPAddress]::Parse( | |
[System.Net.Dns]::GetHostAddresses($hostname) | |
), | |
$port | |
) |
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
#just to name the gist as per https://stackoverflow.com/a/19904644/2518317 |
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
#at top of script | |
if (! | |
#current role | |
(New-Object Security.Principal.WindowsPrincipal( | |
[Security.Principal.WindowsIdentity]::GetCurrent() | |
#is admin? | |
)).IsInRole( | |
[Security.Principal.WindowsBuiltInRole]::Administrator | |
) | |
) { |
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
#recognised protocols | |
$protocols=@{ | |
http =80 ; | |
https=443; | |
} | |
$names=@{ | |
teratext='Content Server'; | |
smb ='Network share' ; | |
ssh ='Remote shell' ; | |
rdp ='Remote desktop'; |
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 bob = () => { | |
let count = 0; | |
for (let e of Array.from(document.querySelectorAll('.NotificationItem__clearIconButton___3pU15'))) { | |
e.click(); | |
++count; | |
} | |
if (count) | |
setTimeout(bob, 5000); | |
}; | |
bob(); |