Skip to content

Instantly share code, notes, and snippets.

View pandemicsyn's full-sized avatar
🌮
everyday is taco tuesday.

Florian Hines pandemicsyn

🌮
everyday is taco tuesday.
View GitHub Profile
@pandemicsyn
pandemicsyn / create_function_plv8_cuid.sql
Created March 13, 2024 02:07 — forked from notakaos/create_function_plv8_cuid.sql
cuid for PostgreSQL with PL/v8
-- original code: https://github.com/ericelliott/cuid
-- Add the "plv8" extension
create extension if not exists "plv8";
-- Add the "pgcrypto" extension
create extension if not exists "pgcrypto";
\dx
-- Connect a database
package main
import (
"bytes"
"compress/gzip"
"crypto/md5"
"encoding/binary"
"encoding/json"
"fmt"
"bufio"
import os
import os.path
import sys
from graphite.render.hashing import ConsistentHashRing
instances = []
unwelcome_instances = []
for arg in sys.argv[1:]:
unwelcome = False