Skip to content

Instantly share code, notes, and snippets.

View DarqueWarrior's full-sized avatar

Donovan Brown DarqueWarrior

View GitHub Profile
@DarqueWarrior
DarqueWarrior / Deploy-AzureResourceGroup.ps1
Created February 3, 2019 01:22
Updated Deploy-AzureResourceGroup.ps1 to use Az PowerShell module
#Requires -Version 6.0
Param(
[string] [Parameter(Mandatory=$true)] $ResourceGroupLocation,
[string] $ResourceGroupName = 'AppServiceAndSql',
[switch] $UploadArtifacts,
[string] $StorageAccountName,
[string] $StorageContainerName = $ResourceGroupName.ToLowerInvariant() + '-stageartifacts',
[string] $TemplateFile = 'WebSiteSQLDatabase.json',
[string] $TemplateParametersFile = 'WebSiteSQLDatabase.parameters.json',
@DarqueWarrior
DarqueWarrior / templatepack.csproj
Last active June 20, 2021 07:23
Skeleton of csproj file for packing a dotnet new template into a nuget package.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Title></Title>
<Authors></Authors>
<Description></Description>
<PackageId></PackageId>
<PackageTags></PackageTags>
<PackageType>Template</PackageType>
<PackageVersion>1.0</PackageVersion>
<TargetFramework>netcoreapp3.1</TargetFramework>
@DarqueWarrior
DarqueWarrior / development.js
Created June 11, 2022 13:21
Development section for truffle-config.js
development: {
host: '127.0.0.1',
port: 8545,
network_id: '*'
}
@DarqueWarrior
DarqueWarrior / getK8sVersion.ps1
Created August 23, 2022 22:13
PowerShell Snippet: Using the Azure CLI to find the latest supported K8s version in a location. I use this to pass to my Bicep files to create an AKS with the latest version.
Write-Output 'Finding version of K8s'
$location = 'eastus'
# Use index -1 to get the last entry which should be
# the latest version
$k8sversion = $(az aks get-versions --location $location `
--query orchestrators[-1].orchestratorVersion `
--output tsv)
Write-Verbose "k8s version = $k8sversion"
@DarqueWarrior
DarqueWarrior / launch.json
Created August 27, 2022 19:08
How to launch 3 Dapr services at the same time with debug enabled. You can set breakpoints in all three services and step from one to the other.
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"compounds": [
// For more information, visit: https://code.visualstudio.com/docs/editor/debugging#_compound-launch-configurations
{
"name": "All Services",
"preLaunchTask": "build",
@DarqueWarrior
DarqueWarrior / expirationDate.txt
Last active March 11, 2024 01:24
This Excel function will extract the expiration date in an Excel Date time serial number format from the Action column from a Fidelity CSV download file.
=IF([@[Option Trade]],
DATE(
LEFT(YEAR(NOW()),2)&MID([@Action],FIND("$",[@Action])-3,2),
MONTH(MID([@Action],FIND("$",[@Action])-10,3)&1),
MID([@Action],FIND("$",[@Action])-6,2)
),
"")
@DarqueWarrior
DarqueWarrior / OptionTradeV2.txt
Created March 11, 2024 14:40
This function will identify option trades using Buy To Close and Sell To Open.
=OR([@[Buy To Close]],[@[Sell To Open]])
@DarqueWarrior
DarqueWarrior / SellToOpen.txt
Created March 11, 2024 22:31
Populates a column with TRUE or FALSE for each row of the Fidelity transaction history download if this was a Sell To Open option trade.
=LEFT([@Action], 17) = " YOU SOLD OPENING"
@DarqueWarrior
DarqueWarrior / BuyToClose.txt
Created March 11, 2024 22:31
Populates a column with TRUE or FALSE for each row of the Fidelity transaction history download if this was a Buy To Close option trade.
=LEFT([@Action], 19) = " YOU BOUGHT CLOSING"
@DarqueWarrior
DarqueWarrior / StrikePrice.txt
Created March 12, 2024 01:32
Populates a column with strike price for each row of the Fidelity transaction history download if it was an option trade.
=IF([@[Option Trade]],
NUMBERVALUE(MID([@Action], FIND("$", [@Action]) + 1, FIND(" ", [@Action], FIND("$", [@Action])) - FIND("$", [@Action]) - 1), "."),
"")