Skip to content

Instantly share code, notes, and snippets.

@zachwhalen
Last active June 2, 2018 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zachwhalen/20e6e0ba7eb88fa66f8e16e2077ae168 to your computer and use it in GitHub Desktop.
Save zachwhalen/20e6e0ba7eb88fa66f8e16e2077ae168 to your computer and use it in GitHub Desktop.
A bash script to create and open a new text file with the appropriate header for a blog post in a Pico site.
nn() {
# the header template
ft="---
Title: Untitled Note
Template: blog-post
Description: New Note
Date: $(date)
Tags:
---";
# save the date in seconds so it can be used twice
dn=$(date +%s);
# make the file
echo "$ft" > ~/pg/notes/note-$dn.md;
# open the file in Sublime
subl ~/pg/notes/note-$dn.md;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment