Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env node
# This script is for getting the DB schema from a database that requires SSL verification by providing a certificate
# For example, AWS RDS instances will require this
# This script takes a database url and a path to the certificate, then runs the pg_dump command
#
# This is very useful for tools like dbdiagram.io
const { exec } = require("child_process");
const path = require("path");
const { exec } = require("child_process");
const path = require("path");
const dbUrl = process.argv[2];
const certPath = process.argv[3];
if (!dbUrl) {
console.error(`No DB URL given`);
help();
}
const unitTypes = [ // https://public-dhhs.ne.gov/nfocus/HowDoI/howdoi/usps_address_unit_types.htm
'APT',
'BLDG',
'BSMT',
'DEPT',
'FL',
'FRNT',
'HNGR',
'KEY',
'LBBY',
@mmgroner
mmgroner / states.js
Created September 15, 2023 16:56
Javascript object mapping every U.S. state as it is spelled correctly to their respective, two-letter couterparts
const states = {
'Alabama': 'AL',
'Alaska': 'AK',
'Arizona': 'AZ',
'Arkansas': 'AR',
'California': 'CA',
'Colorado': 'CO',
'Connecticut': 'CT',
'Delaware': 'DE',
'Florida': 'FL',
@mmgroner
mmgroner / starship.toml
Created August 3, 2023 13:59
Starship Configuration File
# Get editor completions based on the config file
"$schema" = 'https://starship.rs/config-schema.json'
# Inserts a blank line between shell prompts
add_newline = true
continuation_prompt = "↪ "
command_timeout = 1000
# Replace the ">" symbol in the prompt with "λ"