This file contains 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
class Guid { | |
public static newGuid(): Guid { | |
return new Guid(crypto.randomUUID()); | |
// Old IE supported way: | |
/*return new Guid('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => { | |
const r = Math.random() * 16 | 0; | |
const v = (c == 'x') ? r : (r & 0x3 | 0x8); | |
return v.toString(16); | |
}));*/ |
This file contains 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 Get-ScriptPath { | |
$scriptDir = Get-Variable PSScriptRoot -ErrorAction SilentlyContinue | ForEach-Object { $_.Value } | |
if (!$scriptDir) { | |
if ($MyInvocation.MyCommand.Path) { | |
$scriptDir = Split-Path $MyInvocation.MyCommand.Path -Parent | |
} | |
} | |
if (!$scriptDir) { | |
if ($ExecutionContext.SessionState.Module.Path) { | |
$scriptDir = Split-Path (Split-Path $ExecutionContext.SessionState.Module.Path) |
This file contains 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
$PSPath = 'MACHINE/WEBROOT/APPHOST/' + $WebsiteName | |
$Filter = 'system.webServer/httpProtocol/customHeaders' | |
# Ensure working with IIS 7 and 7.5(+?) | |
try { | |
Add-PSSnapin WebAdministration | |
} | |
catch { | |
try { | |
Import-Module WebAdministration |
This file contains 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
var timer = null; | |
var scrollEvent = function () { | |
if(timer!=null) | |
clearTimeout(timer); | |
timer = setTimeout(function(){ | |
console.log('hello'); | |
}, 100); | |
} |