Skip to content

Instantly share code, notes, and snippets.

@kjaymiller
Last active December 24, 2022 02:48
Show Gist options
  • Save kjaymiller/bab7060204e7ac2da4fa540b3dbac6a1 to your computer and use it in GitHub Desktop.
Save kjaymiller/bab7060204e7ac2da4fa540b3dbac6a1 to your computer and use it in GitHub Desktop.
Create Daily Log
import sys
import pathlib
from datetime import datetime
today = datetime.today().strftime("%Y-%m-%d")
# Change the path to your notes folder
today_path = pathlib.Path(f"/PATH/TO/YOUR/NOTES/FOLDER/{today}.md")
if not today_path.exists():
today_path.write_text(f"# {today}\n\n#This is a daily log\n\nBe sure to leave cursor on a new line")
today_path.touch(exist_ok=True)
with open(today_path, "a") as f:
f.write(f"- {sys.argv[1]}\n")
import sys
import pathlib
from datetime import datetime
today = datetime.today().strftime("%Y-%m-%d")
# Change the path to your notes folder
today_path = pathlib.Path(f"/PATH/TO/YOUR/NOTES/FOLDER/{today}.md")
if not today_path.exists():
today_path.write_text(f"# {today}\n\n")
with open(today_path, "a") as f:
f.write(f"- {sys.argv[1]}\n")
@kjaymiller
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment