Skip to content

Instantly share code, notes, and snippets.

View lethek's full-sized avatar

Michael Monsour lethek

  • Workday
  • Brisbane, Australia
  • 08:13 (UTC +10:00)
  • X @lethek
View GitHub Profile
@lethek
lethek / DeleteAllExternalAzureDevopsNugetArtifacts.ps1
Created June 13, 2023 01:29
Deletes all externally sourced NuGet packages from an Azure DevOps Artifacts feed
param(
[Parameter(Mandatory=$True, Position=0)]
[System.String]
$organization,
[Parameter(Mandatory=$True, Position=1)]
[System.String]
$feedName,
[Parameter(Mandatory=$True, Position=2)]
@lethek
lethek / RouteInfo.cs
Last active March 23, 2022 01:13
Check for matching route in ASP.NET MVC 5
using System;
using System.Web;
using System.Web.Routing;
namespace Example
{
public class RouteInfo
{
'<begin script sample>
'This script provides high availability for IIS websites
'By default, it monitors the "Default Web Site" and "DefaultAppPool"
'To monitor another web site, change the SITE_NAME below
'To monitor another application pool, change the APP_POOL_NAME below
'More thorough and application-specific health monitoring logic can be added to the script if needed
Option Explicit
@lethek
lethek / AirtimeHub.cs
Last active March 27, 2017 22:22
Using Autofac to inject dependencies into SignalR hubs and manage dependency lifetimes: management of the lifetimes of dependencies will happen automatically as long as the Hub inherits from AirtimeHub and the dependencies are registered with Autofac with a InstancePerLifetimeScope() option.
using System;
using Microsoft.AspNet.SignalR;
namespace Airtime.Hubs
{
/// <summary>
/// Hubs that have injected dependencies which must be scoped to the same lifetime should