Skip to content

Instantly share code, notes, and snippets.

View Boggin's full-sized avatar
💭
bleep bloop blorp

Richard Bogle Boggin

💭
bleep bloop blorp
View GitHub Profile
@Boggin
Boggin / README.md
Created December 19, 2025 09:53
Demo for minimum Aspire project

Demo for minimum Aspire project

Introduction

How to create a minimum Aspire project that uses Service Bus and Event Hub emulators with a Function App.

This was tested with .net10

Setup

@Boggin
Boggin / Get-ArchiveSize.ps1
Created March 9, 2021 17:11
Get the monthly average folder size
<#
Given the list of folders and the dates over which to check then this script
will group the files by month for each folder between the given dates and get
the sum of the file sizes. So you will get a calculated property of 'folder',
'month', 'size' (where file size is in MB to two decimal places). Then that
calculated property is grouped by 'folder' and the cumulative file size over the
selected months is averaged. So you will have a calculated property of 'folder',
'monthly' (where 'monthly' is a monthly average in MB).
#>
$archives = @{
@Boggin
Boggin / BitLockerSmartCardYubiKey.md
Created January 17, 2021 10:53
Use YubiKey Smart Card for BitLocker on W10

Use YubiKey Smart Card for BitLocker on W10

Create certificate

The certificate will be an Encrypting File System (EFS) self-signed smart card certificate.

  • Control Panel > User Accounts > Manage your file encryption certificates
    Create new and store locally

YubiKey Manager

@Boggin
Boggin / keyboard.ahk
Last active May 7, 2020 20:37
Colemak Mod-DH Angle Extend AutoHotkey layout
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; Colemak Mod-DH angle wide mapping for ANSI boards
SC029::Esc
;SC002::1
;SC003::2
@Boggin
Boggin / git-filter-repo.md
Last active June 23, 2025 11:28
Using git-filter-repo to rewrite history and remove secrets

Removing Secrets In Your Git Repository

If you have a code-base under source control that is internal to your company, for instance, it's hosted on premises, you may have checked in some secrets in your configuration files. We all know we should have had those encrypted or kept outside of the checked-in source in some way but perhaps it was just better to accrue some technical debt and worry about it later. Okay, now it's later.

git-filter-repo

Import-Module SqlServer
$srv = New-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
$db = $srv.Databases.Item("IntermediaryManagement.DB")
$scrp = New-Object Microsoft.SqlServer.Management.Smo.Scripter($srv)
$scrp.Options.ScriptData = $TRUE
$scrp.Options.ScriptSchema = $FALSE
$tbl = $db.tables | Where-Object { $_.IsSystemObject -eq $FALSE }
$scrp.EnumScript(@($tbl)) | %{ Add-Content temp.sql $_ }
@Boggin
Boggin / SqlExceptionMocker.cs
Last active November 9, 2018 17:46 — forked from martinjw/SqlExceptionMocker.cs
Create a SqlException for testing
// .csproj
// <PackageReference Include="System.Data.SqlClient" Version="4.3.0" />
// <PackageReference Include="System.Reflection.TypeExtensions" Version="4.3.0" />
namespace HorribleThingsInHere
{
using System.Data.SqlClient;
using System.Linq;
using System.Reflection;
public struct Option<T>
{
private readonly T _value;
public T Value
{
get
{
if (!HasValue)
throw new InvalidOperationException();
@Boggin
Boggin / .git-commit-template.txt
Last active June 28, 2024 10:16 — forked from adeekshith/.git-commit-template.txt
Enforce good commit message practices across teams.
# <type>[(optional scope)]: <subject>
# |<---- Using a Maximum Of 50 Characters ---->|
# Explain why this change is being made.
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any relevant tickets, articles or other resources,
# |<---- use git-interpret-trailers, for example ---->|
# Issue #23

Git Workflow

Names for branches

  • feature
  • fix
  • hotfix
  • spike

Major branches

  • release (to staging)