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
[cmdletbinding()] | |
param( | |
[string]$Channel="LTS", | |
[string]$Version="Latest", | |
[string]$JSonFile, | |
[string]$InstallDir="<auto>", | |
[string]$Architecture="<auto>", | |
[ValidateSet("dotnet", "aspnetcore", "windowsdesktop", IgnoreCase = $false)] | |
[string]$Runtime, | |
[Obsolete("This parameter may be removed in a future version of this script. The recommended alternative is '-Runtime dotnet'.")] |
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
$version = (Get-Content package.json) -join "`n" | ConvertFrom-Json | Select -ExpandProperty "version" | |
$buildCounter = "%build.counter%" | |
$buildNumber = "$version.$buildCounter" | |
Write-Host "##teamcity[buildNumber '$buildNumber']" |
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
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | |
Add-Type -AssemblyName System.IO.Compression.FileSystem | |
$token = Read-Host -Prompt 'Github PAT' | |
if(!$token) {$token = ""} | |
$org = Read-Host -Prompt 'Org or User' | |
if(!$org) {$org = ""} | |
$repo = Read-Host -Prompt 'Repo' |
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
# based on https://stackoverflow.com/a/15121461 | |
Function Replace-InvalidFileNameChars { | |
param( | |
[Parameter(Mandatory=$true, | |
Position=0, | |
ValueFromPipeline=$true, | |
ValueFromPipelineByPropertyName=$true)] | |
[String]$Name | |
) |
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
#powershell script port of https://github.com/maxhauser/semver/ | |
function toSemVer($version){ | |
$version -match "^(?<major>\d+)(\.(?<minor>\d+))?(\.(?<patch>\d+))?(\-(?<pre>[0-9A-Za-z\-\.]+))?(\+(?<build>[0-9A-Za-z\-\.]+))?$" | Out-Null | |
$major = [int]$matches['major'] | |
$minor = [int]$matches['minor'] | |
$patch = [int]$matches['patch'] | |
if($matches['pre'] -eq $null){$pre = @()} | |
else{$pre = $matches['pre'].Split(".")} |
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
<!-- 1. Define some markup --> | |
<div id="btn" data-clipboard-text="1"> | |
<span>Copy</span> | |
</div> | |
<!-- 2. Include library --> | |
<script src="clipboard.min.js"></script> | |
<!-- 3. Instantiate clipboard by passing a HTML element --> | |
<script> |
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 CopyToClipBoardHandler(value) { | |
const copyListener = event => { | |
document.removeEventListener('copy', copyListener, true); | |
event.preventDefault(); | |
const clipboardData = event.clipboardData; | |
clipboardData.clearData(); | |
clipboardData.setData('text/plain', value); | |
}; | |
document.addEventListener('copy', copyListener, true); | |
document.execCommand('copy'); |
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
export const authConfig: AuthConfig = { | |
// Url of the Identity Provider | |
issuer: "https://demo.identityserver.io", | |
requireHttps: true, | |
// URL of the SPA to redirect the user to after login | |
redirectUri: "http://localhost:2020/", | |
// URL of the SPA to redirect the user after silent refresh | |
silentRefreshRedirectUri: "http://localhost:2020/silent-refresh.html", |
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
export function guard() { | |
return function (target: Object, propertyKey: string, descriptor: TypedPropertyDescriptor<any>) { | |
const originalMethod = descriptor.value; | |
descriptor.value = function (...args: any[]) { | |
return false ? originalMethod.apply(this, args) : console.log('not authorized.'); | |
}; | |
return descriptor; | |
}; |
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
declare @tableName varchar(200) | |
declare @columnName varchar(200) | |
declare @nullable varchar(50) | |
declare @datatype varchar(50) | |
declare @maxlen int | |
declare @sType varchar(50) | |
declare @sProperty varchar(200) | |
DECLARE table_cursor CURSOR FOR |
NewerOlder