Skip to content

Instantly share code, notes, and snippets.

@dougbu
dougbu / Startup.cs
Created October 19, 2016 19:24
Alternate Startup pattern for option settings. Especially useful when the settings rely on services.
using System.Globalization;
using System.Reflection;
using Localized._1._1_preview.Models;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Razor;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.FileProviders;
See https://dev.azure.com/dnceng/public/_build/results?buildId=596411 build of https://github.com/dotnet/aspnetcore/pull/20704
:: Disks before ::
Filesystem Size Used Avail Use% Mounted on
udev 3.4G 0 3.4G 0% /dev
tmpfs 697M 8.9M 689M 2% /run
/dev/sda1 84G 70G 14G 85% /
tmpfs 3.5G 8.0K 3.5G 1% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 3.5G 0 3.5G 0% /sys/fs/cgroup
@dougbu
dougbu / FindMasterBranch.ps1
Last active April 9, 2021 23:51
Find all git repos under current location and report on their branches
# This script will find all subdirectories in the current directory that are Git repos
# and whose official GitHub repo has migrated to main but you still have master or dev branches.
Push-Location
[string[]] $local:repos = @()
if (Test-Path -PathType Container .git) {
$repos += "$PWD"
} else {
$repos = Get-ChildItem -Directory -Recurse |