Skip to content

Instantly share code, notes, and snippets.

@tdlm
Last active December 14, 2022 23:07
Show Gist options
  • Save tdlm/cca31b0b78f1bca892ce2a78f180ca50 to your computer and use it in GitHub Desktop.
Save tdlm/cca31b0b78f1bca892ce2a78f180ca50 to your computer and use it in GitHub Desktop.
Helper 'notes' command for making new notes for dev syncs, interviews and meetings using template Markdown files.

Dev Sync - {DATE}

Participants: Weaver

Discussion Topics

  • Previous Action Items
  • Announcements
  • Current Tickets

Discussion

Previous Action Items

Announcements

Current Tickets

Action Items

Interview with {NAME} - {DATE}

[Links_go_here]

[Summary]

[Discussion]

[General] Tell me about yourself.

[Resume] What are you most proud of in your time at [Last_Company]?

[Resume] Your resume talks about X. Tell me about that?

[Conclusion]

[Questions-for-me?]

{TITLE} - {DATE}

Participants: Weaver

Discussion

Action Items

  • [ ]
#!/usr/bin/env bash
# NOTE: Put me in /usr/local/bin/notes
case "$1" in
"devsync")
DATE=$(date "+%Y/%m") && NOTES_DIR_PATH=$(echo "$HOME/Documents/Notes/$DATE")
DATE=$(date "+%Y-%m-%d") && NOTES_FILE_PATH=$(echo "$NOTES_DIR_PATH/$DATE-Dev_Sync.md")
echo "Creating dev sync for today in $NOTES_FILE_PATH..."
if [ ! -d "$NOTES_DIR_PATH" ]; then
mkdir -p "$NOTES_DIR_PATH"
fi
if [ -f "$NOTES_FILE_PATH" ]; then
echo "$NOTES_FILE_PATH already exists."
else
DATE=$(date "+%Y-%m-%d") && cat "$HOME/Documents/Notes/Dev_Sync_Template.md" | sed "s|{DATE}|${DATE}|" > "$NOTES_FILE_PATH"
fi
echo "The file is: $NOTES_FILE_PATH"
code "$HOME/Documents/Notes" $NOTES_FILE_PATH
;;
"interview")
echo "Enter interview candidate name:"
read CANDIDATE_NAME
CANDIDATE_FILE=$(echo ${CANDIDATE_NAME:-"New Candidate"} | sed 's/\ /_/g')
DATE=$(date "+%Y/%m") && INTERVIEW_DIR_PATH=$(echo "$HOME/Documents/Notes/$DATE")
DATE=$(date "+%Y-%m-%d") && INTERVIEW_FILE_PATH=$(echo "$INTERVIEW_DIR_PATH/$DATE-Interview_with_$CANDIDATE_FILE.md")
if [ ! -d "$INTERVIEW_DIR_PATH" ]; then
mkdir -p "$INTERVIEW_DIR_PATH"
fi
if [ -f "$INTERVIEW_FILE_PATH" ]; then
echo "$INTERVIEW_FILE_PATH already exists."
else
DATE=$(date "+%Y-%m-%d") && cat "$HOME/Documents/Notes/Interview_Template.md" | sed "s|{NAME}|${CANDIDATE_NAME}|" | sed "s|{DATE}|${DATE}|" > "$INTERVIEW_FILE_PATH"
fi
echo "The file is: $INTERVIEW_FILE_PATH"
code "$HOME/Documents/Notes" $INTERVIEW_FILE_PATH
;;
"meeting")
echo "Enter meeting title:"
read MEETING_NAME
MEETING_NAME=${MEETING_NAME:-"Meeting"}
MEETING_FILE=$(echo ${MEETING_NAME} | sed 's/\ /_/g')
DATE=$(date "+%Y/%m") && MEETING_DIR_PATH=$(echo "$HOME/Documents/Notes/$DATE")
DATE=$(date "+%Y-%m-%d") && MEETING_FILE_PATH=$(echo "$MEETING_DIR_PATH/$DATE-$MEETING_FILE.md")
if [ ! -d "$MEETING_DIR_PATH" ]; then
mkdir -p "$MEETING_DIR_PATH"
fi
if [ -f "$MEETING_FILE_PATH" ]; then
echo "$MEETING_FILE_PATH already exists."
else
DATE=$(date "+%Y-%m-%d") && cat "$HOME/Documents/Notes/Meeting_Template.md" | sed "s|{TITLE}|${MEETING_NAME}|" | sed "s|{DATE}|${DATE}|" > "$MEETING_FILE_PATH"
fi
echo "The file is: $MEETING_FILE_PATH"
code "$HOME/Documents/Notes" $MEETING_FILE_PATH
;;
"scratch")
DATE=$(date "+%Y/%m") && NOTES_DIR_PATH=$(echo "$HOME/Documents/Notes/$DATE")
DATE=$(date "+%Y-%m-%d") && NOTES_FILE_PATH=$(echo "$NOTES_DIR_PATH/$DATE-Scratch.md")
echo "Creating dev sync for today in $NOTES_FILE_PATH..."
if [ ! -d "$NOTES_DIR_PATH" ]; then
mkdir -p "$NOTES_DIR_PATH"
fi
if [ -f "$NOTES_FILE_PATH" ]; then
echo "$NOTES_FILE_PATH already exists."
else
DATE=$(date "+%Y-%m-%d") && cat "$HOME/Documents/Notes/Scratch_Template.md" | sed "s|{DATE}|${DATE}|" > "$NOTES_FILE_PATH"
fi
echo "The file is: $NOTES_FILE_PATH"
code "$HOME/Documents/Notes" $NOTES_FILE_PATH
;;
*)
echo "usage: notes [devsync|interview|meeting|scratch]"
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment