Skip to content

Instantly share code, notes, and snippets.

@capocasa
capocasa / postgres-database-setup
Last active January 1, 2024 12:36
Triple-Redundant Hetzner Debian postgres setup
##### This is how to set up a triple redundant postgres.
##### Use a main box on Hetzner, a secondary small box on Hetzner in a
##### different datacenter for query replication, and a Hetzner Storage-Box
##### for file replication.
##### There will always be two copies of the data in different datacenters by the time
##### the transaction completes.
##### Here, Wireguard is used to have an internal network between the two hosts,
##### but Hetzner networks could also be used. SSH access between the two boxes
@juliusmarminge
juliusmarminge / enum-generator.ts
Last active February 21, 2024 07:22
prisma enum generator
import { generatorHandler } from "@prisma/generator-helper";
import fs from "node:fs/promises";
import path from "node:path";
const header = `// This file was generated by a custom prisma generator, do not edit manually.\n`;
generatorHandler({
onManifest() {
return {
defaultOutput: "./enums/index.ts",
@inxilpro
inxilpro / README.md
Created July 22, 2022 21:01
Fully namespaced Tailwind config for widget or embeddable component

Sometimes you need to publish a CSS file for 3rd-party consumption (i.e. default styles for an embeddable JS widget). This set up lets you continue to use Tailwind, but scope all your styles to a specific selector.

Simply replace .internachi with your own widget namespace, set up Tailwind as you please, and run generate.sh to build a custom version of your Tailwind styles that won't interfere with other CSS rules (including the Tailwind reset).

@victornpb
victornpb / deleteDiscordMessages.js
Last active April 16, 2024 09:32
Delete all your messages from DM or Channel in Discord
/*
This file is now hosted here:
https://github.com/victornpb/undiscord
*/