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
using System.Diagnostics; | |
using System.Runtime.InteropServices; | |
using CounterStrikeSharp.API; | |
using CounterStrikeSharp.API.Core; | |
namespace ConCommandTesting; | |
public class ConCommandTesting : BasePlugin | |
{ | |
public override string ModuleName => "ConCommandTesting"; |
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 class BackgroundHandler { | |
#tasks: Record< | |
string, | |
{ | |
task: () => void; | |
timer: ReturnType<typeof setTimeout>; | |
isPaused: boolean; | |
} | |
> = {}; |
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
#Requires -module Az.Accounts | |
function Get-AzPortalToken { | |
<# | |
.SYNOPSIS | |
Refreshes the API token if required | |
.OUTPUTS | |
API Token Object | |
.NOTES | |
Inspired by https://github.com/Azure/azure-powershell/issues/7525#issuecomment-432384270 | |
Stolen from https://github.com/JustinGrote/Az.PortalAPI/blob/master/Az.PortalAPI/Public/Get-Token.ps1 |
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-AzPortalEnterpriseApp { | |
[CmdletBinding(SupportsShouldProcess)] | |
param ( | |
#Filter by display name or application ID | |
[String]$Filter, | |
#Set the result size. Default is first 50 results | |
[int]$ResultSize = 50 | |
) | |
$InvokeApiRequestParams = @{ |
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 Invoke-AzPortalRequest { | |
<# | |
.SYNOPSIS | |
Runs a command against the Azure Portal API | |
.NOTES | |
Originally stolen from https://github.com/JustinGrote/Az.PortalAPI/blob/master/Az.PortalAPI/Public/Invoke-Request.ps1 | |
#> | |
[CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'High')] |
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
Add-Type @" | |
using System.Linq; | |
using System; | |
public class EditDistance { | |
public static int CheckEditDistance (string original, string modified) | |
{ | |
int len_orig = original.Length; | |
int len_diff = modified.Length; | |
var matrix = new int[len_orig + 1, len_diff + 1]; |
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
/* | |
Copyright 2017 Bryan Keller (https://github.com/widget-) | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |