News for hackers. Stuff that matters.
Re:I Wrote Down Everything I Learned While Programming for a... by lwerdna on Monday February 12, 2018 @09:43AM (#16358837)
Here's a poor man's version of dnote in my .bashrc. It's the only thing I've used consistently:

  notes() {
  	local fpath=$HOME/notes.md
  	if [ "$1" == "gvim" ]; then
  		gvim + $fpath
  	elif [ "$1" == "vim" ]; then
  		gvim + $fpath
  	elif [ "$1" == "date" ]; then
  		echo '' >> $fpath
  		echo '# '`date +"%m-%d-%Y-%T"` >> $fpath
  		echo '---------------------' >> $fpath
  	elif [ "$1" == "" ]; then
  		less +G $fpath
  	else
  		echo '' >> $fpath
  	    echo $@ >> $fpath
  	fi
  }
Insert the current date with `notes date`. Store a note with `notes the earth is about 25k miles around` or `notes dentist appointment Thursday` or `notes purfunctory - carried out with a minimum of effort or reflection #vocab`. Look up recent notes with `notes` or read/search the entire notes database with `notes vim`.
Re:I Wrote Down Everything I Learned While Programming for a... by dgritsko on Monday February 12, 2018 @10:00AM (#16358960)
I really appreciate the minimalism of this approach. Going to give this a try, thanks for sharing!
Re:I Wrote Down Everything I Learned While Programming for a... by demilicious on Monday February 12, 2018 @12:21PM (#16360126)
Yeah, this is really useful. I think it'll break on single quotes: `notes we'll need oranges tomorrow`, but otherwise, it's a very low-friction method, to me.
Re:I Wrote Down Everything I Learned While Programming for a... by dgritsko on Monday February 12, 2018 @04:05PM (#16362146)
Yeah, had a similar issue with parentheses while using it today (but escaping them with '\' worked just fine).
Re:I Wrote Down Everything I Learned While Programming for a... by Froyoh on Monday February 12, 2018 @12:40PM (#16360288)
Can this be used with nano as well?
Re:I Wrote Down Everything I Learned While Programming for a... by guessmyname on Monday February 12, 2018 @05:25PM (#16362938)
Yes, if you change all references of "gvim" to "nano".
Re:I Wrote Down Everything I Learned While Programming for a... by askafriend on Monday February 12, 2018 @01:47PM (#16360863)
Why not just use Notes.app?
Re:I Wrote Down Everything I Learned While Programming for a... by guessmyname on Monday February 12, 2018 @05:24PM (#16362919)
> Why not just use Notes.app?

Because not everyone uses macOS.

This shell script works on most Unix-like systems unlike Notes.app

Re:I Wrote Down Everything I Learned While Programming for a... by tangue on Monday February 12, 2018 @05:54PM (#16363148)
Notes will try to insert smart quotes in your code and other silent changes (made to improve text notes but catastrophic for code.)