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( | |
| [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$false)] | |
| [string] | |
| $privateKey, | |
| [Parameter(Mandatory=$false, Position=1, ValueFromPipeline=$false)] | |
| [string] | |
| $delim = "\r\n" | |
| ) |
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( | |
| [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$false)] | |
| [string] | |
| $secret, | |
| [Parameter(Mandatory=$true, Position=1, ValueFromPipeline=$false)] | |
| [string] | |
| $message | |
| ) |
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
| // This file was initially generated by Windows Terminal 1.2.2381.0 | |
| // It should still be usable in newer versions, but newer versions might have additional | |
| // settings, help text, or changes that you will not see unless you clear this file | |
| // and let us generate a new one for you. | |
| // To view the default settings, hold "alt" while clicking on the "Settings" button. | |
| // For documentation on these settings, see: https://aka.ms/terminal-documentation | |
| { | |
| "$schema": "https://aka.ms/terminal-profiles-schema", |
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
| Enum PaymentTypes | |
| { | |
| Visa | |
| MasterCard | |
| AmericanExpress | |
| Discover | |
| JapanCreditBureau | |
| DinersClub | |
| } |
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
| SomePassword # Replace literal string 'SomePassword' with '***REMOVED***' (default) | |
| SomePassword==>examplePass # Replace with 'examplePass' instead | |
| SomePassword==> # Replace with the empty string | |
| regex:password=\w+==>password= # Replace, using a regex | |
| regex:\r(\n)==>$1 # Replace Windows newlines with Unix newlines | |
| regex:(?i)(passsWord)==> # Replace "password" insensitively | |
| regex:\"Number\":\s+\"\d+\"==>"Number: "***REMOVED***" # Remove number after "Number": | |
| # Ensure that multi-line flag is used (java -jar bfg.jar --multi-line-regex --replace-text bfg_replace.txt) | |
| regex:(?s)-----BEGIN RSA PRIVATE KEY-----(.+)-----END RSA PRIVATE KEY-----==>REMOVED |
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
| # Already case-insensitive. Use -cmatch and -creplace for case-sensitive matching and replacement. | |
| (Get-Content input.json) ` | |
| -replace '\d{15,19}', {'*' * ($_.Value.Length-4) + $_.Value.Substring($_.Value.Length - 5, 4)} ` | |
| -replace '(\"expirationMonth\":)(\s*)("\d{1,2}")', '$1$2"**"' ` | |
| -replace '(\"expirationYear\":)(\s*)("\d{2,4}")', '$1$2"****"' ` | |
| -replace '(\"cvn\":)(\s*)("\d{3,4}")', '$1$2"***"' | | |
| Out-File output.json | |
| # Where $1 is the first group for example "CVN": and $2 is the second group (zero or more spaces) and $3 is the value. |
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 Base62Encode([string] $inputStr = [Guid]::NewGuid().ToString()) | |
| { | |
| [byte[]] $byteArr = [system.Text.Encoding]::UTF8.GetBytes($inputStr) | |
| $converted = BaseConvert $byteArr 256 62 | |
| $sb = [System.Text.StringBuilder]::new() | |
| for ($i = 0; $i -lt $converted.Length; $i++) { | |
| $sb.Append($CharacterSet[$converted[$i]]) | Out-Null | |
| } | |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| namespace Misc.Engines | |
| { | |
| /// <summary> | |
| /// Meant for CPU bound operations. Long running I/O operations should be run |
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
| # .NET Core Function App to Windows on Azure | |
| # Build a .NET Core function app and deploy it to Azure as a Windows function App. | |
| # Add steps that analyze code, save build artifacts, deploy, and more: | |
| # https://docs.microsoft.com/en-us/azure/devops/pipelines/languages/dotnet-core | |
| name: $(Date:yyyyMMdd)$(Rev:.r)-$(SourceBranchName) | |
| trigger: | |
| - master | |
| - develop |
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
| -- Setup | |
| CREATE TABLE Test_INT ([Id] [int] NOT NULL primary key clustered, | |
| [col1] [int] NULL, | |
| [col2] [int] NULL, | |
| [col3] [varchar](50) NULL); | |
| CREATE TABLE Test_GUID ([Id] [uniqueidentifier] NOT NULL primary key clustered, | |
| [col1] [int] NULL, | |
| [col2] [int] NULL, | |
| [col3] [varchar](50) NULL); |