Skip to content

Instantly share code, notes, and snippets.

View jdheyburn's full-sized avatar
👋
Heya!

Joseph Heyburn jdheyburn

👋
Heya!
View GitHub Profile
@jdheyburn
jdheyburn / modify-aws-instance-type.sh
Last active January 6, 2022 11:42
Function to stop AWS instance before changing its instance type, and starting it afterward
# Change AWS instance type by hostname
function modify-aws-instance-type() {
local hostname=$1
if [ -z $hostname ]; then
echo "ERR: hostname not provided, usage:"
echo " modify-aws-instance-type HOSTNAME INSTANCE_TYPE"
return 1
fi
local instance_type=$2
if [ -z $instance_type ]; then
@jdheyburn
jdheyburn / DailySummary.txt
Last active March 21, 2025 08:21
Obsidian journalling templates
<%*
moment.locale("en-gb")
const thisDay = window.moment(new Date(tp.file.title));
const previousDay = thisDay.clone().subtract(1, 'days');
const previousDayFmt = previousDay.format("YYYY-MM-DD")
const lastYearDay = thisDay.clone().subtract(1, 'years');
const nextDay = thisDay.clone().add(1, 'days');
const nextDayFmt = nextDay.format("YYYY-MM-DD")
const thisWeek = thisDay.format("YYYY-[W]ww")
const thisMonth = thisDay.format("YYYY-MM-[M]")
@jdheyburn
jdheyburn / organizeDailyFiles.py
Created March 21, 2025 07:27
Scripts to help move Obsidian journal notes from flat directory structure to nested.
import os
import re
import shutil
from pathlib import Path
# Get the script directory and define the daily directory path
SCRIPT_DIR = Path(__file__).parent
DAILY_DIR = SCRIPT_DIR.parent / "planner" / "daily"
# Function to ensure a directory exists