Skip to content

Instantly share code, notes, and snippets.

View Keboo's full-sized avatar

Kevin B Keboo

View GitHub Profile
@Keboo
Keboo / extension.mjs
Created June 16, 2026 07:07
Copilot extension: todo-list
// Extension: todo-list
// Interactive TODO list canvas. Todos persist to .tmp/todos.json in the
// workspace root and update live via SSE across all open canvas panels.
import { createServer } from "node:http";
import { readFileSync, writeFileSync, mkdirSync, existsSync } from "node:fs";
import { join } from "node:path";
import { randomUUID } from "node:crypto";
import { joinSession, createCanvas, CanvasError } from "@github/copilot-sdk/extension";
@Keboo
Keboo / copilot-extension.json
Last active June 17, 2026 18:55
Copilot extension: chronicle-sessions
{
"name": "chronicle",
"version": 1
}
#!/usr/bin/env bash
root="${1:-.}"
find "$root" -type d | while read -r dir; do
# Strip the root prefix
rel="${dir#$root}"
# Count slashes to determine depth
depth=$(grep -o "/" <<< "$rel" | wc -l)
# Build indentation
@Keboo
Keboo / README.md
Last active September 1, 2024 06:46
Security Resources

Internet Safety

Kevin Bost

Security and Privacy

  1. Privacy: Refers to how your information is used and controlled. It is often related to security but just because something is not private does not mean it is not secure.
  2. Security: Refers to how refers to your information is protected. It is important to keep sensitive information secure.
  3. Information that should be private
    • Financial information (Credit card number, account numbers, bank names, financial status)
    • Personal information (Social security number, family member names, driver’s license number, birth place)
  • Insurance information
@Keboo
Keboo / README.md
Created June 7, 2024 18:41
Snapshot testing in Velopack

How to do snapshot testing on OpenAPI spec

This is a simple writeup of how snapshot testing is done on the OpenAPI spec for Velopack API. Though the implementation can be easily applied to other services.

Setup the API project

The API project should include an OpenAPI endpoint. The most popular libraries for this are Swashbuckle, NSwag, and soon built-in support.

The API project should be configured to serve up the Open API specification. For Velopack, we are using NSwag. The setup in the API resembles the following:

@Keboo
Keboo / App.xaml.cs
Created June 20, 2022 18:07
MarkupExtension with DI
public partial class App : Application
{
[NotNull]
public static IServiceProvider? ServiceProvider { get; private set; }
[STAThread]
public static void Main(string[] args)
{
using IHost host = CreateHostBuilder(args).Build();
host.Start();
@Keboo
Keboo / ConstructorTests.cs
Last active September 1, 2021 06:39
Automatic testing of constructor parameters
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Moq;
using Xunit;
namespace Namespace
{
public interface IConstructorTest
@Keboo
Keboo / IHttpCall.cs
Last active September 22, 2020 15:59
In memory testing of HttpClient
namespace Example.HttpClient.Tests
{
public interface IHttpCall
{
int InvocationsCount { get; }
}
}
@Keboo
Keboo / BrainTeaser.cs
Last active September 20, 2020 04:46
Null constructor brain teaser. Simply replace ??? with any type that will cause the unit test to pass. Code used xUnit.
[Fact]
public static void NullReturnFromConstructor()
{
//Any Nullable<T> will work
Assert.Throws<InvalidOperationException>(() => SudoMakeMeSandwich<???>());
}
private static T SudoMakeMeSandwich<T>() where T : new()
{
return new T() ?? throw new InvalidOperationException();