Skip to content

Instantly share code, notes, and snippets.

View ukcoderj's full-sized avatar

Justin ukcoderj

View GitHub Profile
@ukcoderj
ukcoderj / GetTaskResult-Program.cs
Last active April 3, 2023 11:18
Run a List of Task And Get Results
// See https://aka.ms/new-console-template for more information
using DoTaskAndGetResult;
Console.WriteLine("Hello, World!");
TestClass tc = new TestClass();
List<Task<TestData>> taskList = new List<Task<TestData>>();
for(int i = 0; i < 1000; i++)
@ukcoderj
ukcoderj / acr-azure-container-registry-push-template.ps1
Created October 12, 2022 13:05
Azure Container Registry Push
From solution level:
containerRegistryName = The name of the container registry you create in Azure (acr)
acrRepositoryName = The individual repository within acr (e.g. my-microservice-app)
# Note build is from solution level. You might just need './Dockerfile .'
docker build -t {acrRepositoryName}:latest -f ./VsProjectName/Dockerfile .
az login
az acr login --name {containerRegistryName}
docker tag {acrRepositoryName}:latest {containerRegistryName}.azurecr.io/{acrRepositoryName}:latest;
docker push {containerRegistryName}.azurecr.io/{acrRepositoryName}:latest
@ukcoderj
ukcoderj / Files.md
Created June 28, 2023 10:15
.NET Core - Files - Get Exec Assembly Location

.NET Core - Files - Get Exec Assembly Location

private string GetBasePath()
{
    var path = System.Diagnostics.Process.GetCurrentProcess()!.MainModule!.FileName;
    FileInfo fi = new FileInfo(path);

    // If you'd set something in a 'resources' folder and made the content copy always.
 var basePath = fi.Directory + @"\resources\";