Skip to content

Instantly share code, notes, and snippets.

@dystopiandev
dystopiandev / nugetpackageload.cs
Created December 9, 2023 23:28 — forked from alistairjevans/nugetpackageload.cs
Complete Example Package Loader
using AutoStep.Extensions;
using Microsoft.Extensions.DependencyModel;
using NuGet.Common;
using NuGet.Configuration;
using NuGet.Frameworks;
using NuGet.Packaging;
using NuGet.Packaging.Core;
using NuGet.Packaging.Signing;
using NuGet.Protocol.Core.Types;
using NuGet.Resolver;
@dystopiandev
dystopiandev / postgres.md
Created July 7, 2022 20:34 — forked from phortuin/postgres.md
Set up postgres + database on MacOS (M1)

Based on this blogpost.

Install with Homebrew:

$ brew install postgresql

Run server:

import * as pulumi from "@pulumi/pulumi";
import * as hc from "@pulumi/hcloud";
import { randomUUID } from "crypto";
interface DynamicProviderOutputs {
name: string
configuration: {[index:string]: any};
}
class CtrlConfigurationProvider implements pulumi.dynamic.ResourceProvider {
@dystopiandev
dystopiandev / 1_triggers.sql
Created May 15, 2022 11:45 — forked from fritzy/1_triggers.sql
Get table change notifications from Postgres as JSON
CREATE OR REPLACE FUNCTION table_update_notify() RETURNS trigger AS $$
DECLARE
id bigint;
BEGIN
IF TG_OP = 'INSERT' OR TG_OP = 'UPDATE' THEN
id = NEW.id;
ELSE
id = OLD.id;
END IF;
PERFORM pg_notify('table_update', json_build_object('table', TG_TABLE_NAME, 'id', id, 'type', TG_OP)::text);