Skip to content

Instantly share code, notes, and snippets.

View jordanlambrecht's full-sized avatar

Jordan Lambrecht jordanlambrecht

View GitHub Profile
@jordanlambrecht
jordanlambrecht / NotionDateDifferenceTwxtFormatter.js
Created March 28, 2024 20:02
Notion Formula: Time Difference in Years, Months, and Days
# This formula calculates the difference between the current date and a specified “Date Billed” property in Notion. It breaks down the time difference into years, months, and days, and formats the output in a human-readable string. The formula also correctly pluralizes the time units and omits any unit that has a value of zero.
# Logic:
# - if the date range is less than a month, hide the month and years text so it doesn't show 0
# - if the time period = 1, make it singular instead of plural
# - my example uses a date column called 'Date Billed' and outputs to a column named 'Past Due'
# - Not 100% accurate, as it assumes there are 30 days in a month
@jordanlambrecht
jordanlambrecht / GlobalPostgresDatabase.md
Last active March 30, 2024 21:11
Global Postgres Database using Docker Compose

Goal

  1. Establish a centralized postgres db that all other compose files / containers can access
  2. Allow other containers to automatically create credentials/databases that are scoped specifically for them
  3. Make sure that the databases aren't overwritten each time docker-compose up -d is ran
  4. Avoid having to duplicate entrypoint files and keep the postgres_entrypoint.sh in a centralized location

File Structure

🗂️ docker
|___ 🗂️ DummyStack