Skip to content

Instantly share code, notes, and snippets.

View jordanlambrecht's full-sized avatar

Jordan Lambrecht jordanlambrecht

View GitHub Profile
@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 / 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 / docker-compose.yml
Created March 24, 2024 04:16
Docker-Compose Template
---
name: PROJECT_NAME
version: "3.8"
# ╔══════════════════════════════════════════════════════════════════════════════╗
# ║ ║
# ║ TEMPLATE ║
# ║ ║
# ╚══════════════════════════════════════════════════════════════════════════════╝
# COMMON SERVICES FRAGMENT
@jordanlambrecht
jordanlambrecht / createMacUser.sh
Last active February 25, 2024 03:46
MacOS: Create New System User
#!/bin/bash
## This code is based off of https://raw.githubusercontent.com/Servarr/Wiki/master/servarr/servarr-install-script.sh and re-worked for MacOS users
### Boilerplate Warning
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
#EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
#MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
#NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html data-editor-version="2" class="sg-campaigns" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" />
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<!--<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<xml>

active: true client: Backcountry title: Gearhead Magic date: '2022-01' tags:

- 2d animation

- 3d animation

- Motion design

- 3d modeling

npm init @vitejs/app
code .
echo "# pb-oct-2022" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin git@github.com:jordanlambrecht/pb-oct-2022.git
@jordanlambrecht
jordanlambrecht / email-generator-result.php
Created July 30, 2021 16:38
Two php files that Pixel Bakery uses in conjunction to generate our employee's email signatures for Gmail.
<?php
$phoneInput = $_REQUEST['phonepretty'];
$phonePretty = preg_replace('/\D/', ' ', $phoneInput );
$phoneURL = preg_replace('/\D/', '', $phoneInput);
$name = $_REQUEST['name'];
$position = $_REQUEST['position'];
?>
@jordanlambrecht
jordanlambrecht / .gitignore
Created June 7, 2021 04:32
Jordan's Git Ignore Template
# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~
# ignore everything in the root except the "wp-content" directory.
!wp-content/
# ignore everything in the "wp-content" directory, except:
@jordanlambrecht
jordanlambrecht / autoDeleteGmail.js
Last active May 11, 2024 03:38
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.');