Skip to content

Instantly share code, notes, and snippets.

View rgwood's full-sized avatar

Reilly Wood rgwood

View GitHub Profile
@rgwood
rgwood / Program.cs
Created February 16, 2022 20:58
CLI runner
using System.Threading.Channels;
using CliWrap;
using Spectre.Console;
string command = AnsiConsole.Ask<string>("[bold blue]Command to run[/]");
var channel = Channel.CreateUnbounded<string>();
var processArgumentsTask = Task.Run(async () => {
while (true) {
SELECT version();
SELECT ns.nspname, t.oid, t.typname, t.typtype, t.typnotnull, t.elemtypoid
FROM (
-- Arrays have typtype=b - this subquery identifies them by their typreceive and converts their typtype to a
-- We first do this for the type (innerest-most subquery), and then for its element type
-- This also returns the array element, range subtype and domain base type as elemtypoid
SELECT
typ.oid, typ.typnamespace, typ.typname, typ.typtype, typ.typrelid, typ.typnotnull, typ.relkind,
elemtyp.oid AS elemtypoid, elemtyp.typname AS elemtypname, elemcls.relkind AS elemrelkind,
@rgwood
rgwood / Systemd.cs
Last active January 15, 2022 04:34
Helper to install the current executable as a Systemd service
using CliWrap;
using Spectre.Console;
using System.Diagnostics;
namespace SystemdTemplate;
public static class Systemd
{
/// <summary>
/// Attempt to install the current process as a systemd service
@rgwood
rgwood / settings.md
Last active March 4, 2024 07:05
VS Code Developer Command Prompt

How to add a Developer Command Prompt to VS Code

Using Windows developer CLI tools outside of Visual Studio is way more of a pain than it needs to be. Here's how to set up the VS Developer Command Prompt in VS Code's integrated terminal.

Prerequisites

  • Visual Studio with any workloads you need
  • VS Code

Instructions