Skip to content

Instantly share code, notes, and snippets.

@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
@jordanlambrecht
jordanlambrecht / autoDeleteGmail.js
Last active April 24, 2024 23:52
Auto Delete / Archive Emails in Gmail
function autoDelete() {
console.log('Started autoDelete run.');
var delayDays = 2;
var maxDate = new Date();
maxDate.setDate(maxDate.getDate()-delayDays);
var label = GmailApp.getUserLabelByName("delete me");
var threads = label.getThreads();
if(threads.length > 0){
console.log('Found ' + threads.length + ' emails marked for deletion.');