Originally posted (me: vstuart) as a comment on HackerNews
Ask HN: Coding notes – how do you do them?
[~Feb 02, 2017] For years I kept my coding notes in spiral bound A4 and A5 notebooks. Handwritten notes are quick to create, but hard to search. [ … snip … ] What new solutions are there for capturing and organizing coding notes? How do you do it?
[7 points by vstuart 219 days ago (~Feb 02, 2017)]
Here’s what I do:
- keep my notes in a flat, plain-text “reference” file
key items/entries prefaced/abbreviated with leading double underscores; e.g.
My bash script (
#!/bin/bash # ref.sh # https://stackoverflow.com/questions/7131670/make-bash-alias-that-takes-parameter grep -i -A10000 --color=always __$1 /home/victoria/projects/shortcuts/reference | more
# SEARCH MY 'REFERENCE' FILE: # search my Reference file for argument, tagged (prepended) with two # leading underscores (e.g.: 'ref wget' finds '__wget'): alias ref='/mnt/Vancouver/Programming/scripts/ref.sh' alias ?='/mnt/Vancouver/Programming/scripts/ref.sh' # "free" (unlimited) grep search of my '/mnt/Vancouver/ .reference' file # (e.g. 'ref rename' : i.e., not limited by double-underscore tag): alias refgrep='/mnt/Vancouver/Programming/scripts/refgrep.sh'
When I want to find a note quickly, I launch a terminal, search, then exit out (
$ ref grep
Here is my
refgrep.sh bash script:
#!/bin/bash # refgrep.sh # https://stackoverflow.com/questions/7131670/make-bash-alias-... grep -i -A10 --color=always $1 /home/victoria/projects/shortcuts/reference | more
With either script |
ref.sh | ref refgrep.sh | refgrep
partial strings are automatically searched.
[ I created/sometimes use my
refgrep script as sometimes I can’t remember the name of a specific
For example, if you have two or more placemarkers that are similar,
ref pywill find the first one
- simply extending the string,
ref pythonp(a more specific search) will find the the second one
refgrep <string> will find (the first occurrence) of that string, anywhere in the
I use that
reference file for everything that I might want to quickly find (literally: seconds):
- phone numbers*
- prescriptions, doctors
- programmatic notes
- you name it!
Just pop open a terminal; search (
ref <string>); read; quit terminal.