Skip to content

Instantly share code, notes, and snippets.

View seesharprun's full-sized avatar

Sidney Andrews seesharprun

View GitHub Profile
@seesharprun
seesharprun / Program.cs
Last active November 8, 2024 14:47
Spectre.Console integrated console application (Generic Host)
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Hosting.Internal;
using Spectre.Console;
using Spectre.Console.Cli;
HostApplicationBuilder builder = Host.CreateApplicationBuilder(args);
builder.Services.AddSingleton<IAnsiConsole>((_) =>
AnsiConsole.Create(
@seesharprun
seesharprun / Program.cs
Last active November 8, 2024 03:46
Azure Cosmos DB console application (Generic Host)
using Azure.Identity;
using Microsoft.Azure.Cosmos;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Hosting.Internal;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
HostApplicationBuilder builder = Host.CreateApplicationBuilder(args);
@seesharprun
seesharprun / Program.cs
Last active November 8, 2024 03:40
Simple console application (Generic Host)
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Hosting.Internal;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
HostApplicationBuilder builder = Host.CreateApplicationBuilder(args);
builder.Services.AddSingleton<IHostLifetime, ConsoleLifetime>();
builder.Services.AddScoped<IMessageService, MessageService>();
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
var builder = Host.CreateApplicationBuilder(args);
builder.Services.AddHostedService<PingWorker>();
var host = builder.Build();
await host.RunAsync();
@seesharprun
seesharprun / .gitignore
Created September 8, 2022 15:55
Azure Cosmos DB SQL API + Node.js
node_modules/
package-lock.json
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
@seesharprun
seesharprun / readme.md
Last active April 7, 2022 20:06
[Show Notes] Improve your .NET developer workflow with Docker and Visual Studio Code

Improve your .NET developer workflow with Docker and Visual Studio Code

Docker & .NET

.NET Dockerfile

dotnet --version
dotnet --list-sdks
dotnet --info
@seesharprun
seesharprun / readme.md
Last active March 23, 2022 16:26
Azure Resource Manager demos (CLI, JSON, and Bicep)
@seesharprun
seesharprun / readme.md
Last active April 6, 2022 16:45
Authoring DevOps pipelines using YAML in GitHub Actions
@seesharprun
seesharprun / readme.md
Last active April 6, 2022 17:59
Automating the deployment of Azure Resource Manager templates in your DevOps workflow

Demos

Init app

dotnet new webapp
dotnet new gitignore