Ask HN: Coding notes – how do you do them?
[1] https://news.ycombinator.com/item?id=11890742 [2] https://en.wikipedia.org/wiki/GrandView_(software)
[1] https://news.ycombinator.com/item?id=11890742 [2] https://en.wikipedia.org/wiki/GrandView_(software)
* keep my notes in a flat, plain-text "reference" file
* key items/entries prefaced/abbreviated with leading double underscores; e.g.
__bash
__grep
__birthdays
+ anything else you want
* bash script ("ref.sh"):
#!/bin/bash
# https://stackoverflow.com/questions/7131670/make-bash-alias-that-takes-parameter
grep -i -A10000 --color=always __$1 /home/victoria/projects/shortcuts/reference | more
* ~/.bashrc alias: # ----------------------------------------------------------------------------
# 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'
* Now, when I want to find a note quickly, I launch a terminal, search, then exit out (alias "qq") ;-)* E.g.: $ ref grep
* Image (screenshot): http://imgur.com/a/7WPtD
#!/bin/bash
# https://stackoverflow.com/questions/7131670/make-bash-alias-...
grep -i -A10 --color=always $1 /home/victoria/projects/shortcuts/reference | more
===========================
I should also have mentioned that with either script/alias {ref | refgrep}, partial strings are automatically searched. [I created/use the latter script because sometimes I cannot remember all of my __<entries>.]
For example, if you have two or more placemarkers that are similar (__python | __pythonpath), "ref py" will find the first one; "ref pythonp" will find the the second one ... just extend the string to be more specific, as needed ...
"refgrep <string>" will find (the first occurrence) of that string, anywhere in the "reference" file.
I use that "reference" file for everything that I might want to quickly find (literally, seconds): programming; birthdays; phone numbers; prescriptions, doctors, you-name-it.
Just pop open a terminal; search (ref <string>); read; quit terminal. :-D
Don't ask how I kept notes on the implementation process.
I have a directory called notes that has a bunch of separate text files. Now I've been slowly adding Word files because often I want to include an annotated screenshot.
I've often wished I could paste images into my source code. My editor would generate something like:
/*IMG: BASE64 (or some other image encoding) of the image */
I do ascii art in some places, but too often I have a comment that just says "see flow.png in the documentation directory".You said you chose something lighter weight. What did you end up going with? I've used Evernote for years but am unhappy with the direction the program has gone. The new CEO seems to be refocusing on the core purpose (capturing and remembering) and so I'm contemplating sticking around for a bit.
I use Markdown for pretty much everything I write on my laptop, including notes, so printing them is no issue when I need to so.
I usually go down the "one topic, one file" path, and add a table of content on top (I have a command line tool that does that).
I push a portion of my notes to a public GitHub repo, and all of them in a private Git repo. Random example of me learning Ruby syntax: https://github.com/aleksandar-todorovic/notes/blob/master/21...
I then add it to to the main research (https://my.mindnode.com/83qmKgoATj8TyKzprzsPfoirxa2g9WmFGx3x...) mind map.
It's actually really easy to keep it up to date and it is very rewarding knowing that I can share my knowledge with other people.
I also wrote about my approach about mind mapping here (https://medium.com/@NikitaVoloboev/mind-map-everything-d2767...).
Currently, it's vaguely structured using the emacs org-mode
And indeed, no database, nothing beats the speed and convenience of search with any random editor search function (let alone emacs occurs command or regexp search).
I agree on search which is why I keep a digital index I update every few days. So even a year and a couple of notebooks later I search for something like "notes sql" on evernote and will get back results like "book 4 page 13 sql notes on sharding". I just need to dig book 4 out of my little plastic box I keep my notebooks in and refer :)
https://en.wikipedia.org/wiki/Fundamental_theorem_of_softwar...
Mmm... just noticed that when I make notes, I talk to myself in the plural!
eg:
###############################################################################################
Problem: SalesOrders table has 2,381 distinct SONum records, but 13,489 records. We've got AlienRef in SalesOrders, but the one from Oracle is per SalesLine. Let's drop it from that table. Need to fix the trigger code and SalesOrdersDeleted - done.
Problem: insert Now fails on "Cannot insert the value NULL into column 'LastActivityUser', table 'Zeno_Dev.dbo.SalesReleasesAudit'; column does not allow nulls. INSERT fails." Fixed.
Problem: There's duplicate SOnums in SalesOrders. eg: '100242032'
SoNum 100242032 has TWO deliverypoints
The addresses are the same, because we've got TWO customer numbers with the same delivery point. Aggh.
CustomerID CustNum
3338 721180000
3550 721180015
DeliveryPointID, CustomerRef, DeliveryPointNum
13579 3338 S0015
13814 3550 S0015
When we create SalesOrders, we need to match on DeliveryPointNum AND CustomerRef !
Fixed.- Flat files, allowing diffs and fast searches
- Built-in todo, calendar and punchclock workflows out of the box, right from within your notes.
- diagrams, attachments, links
- syntax highlighting, and code blocks can be executed!
- org-capture for special forms
I use emacs in both windows and linux. It is so worth the learning curve, and org-mode is one of the easiest and most rewarding entry points to emacs - it's how I started with emacs, and now I live in it.
[edit: spacing of bullets]
Example output pdf for sharing:
You can also style the notes by simply dropping a <style> some css element { some css thing: some number } <style> at the top of the note, which can make for decent good looking documents (on par with word etc if you are a css wizard). Also it has built in spaced repetition studying thing, which (the code is there, but I'm in the slow process of debugging it since I messed it up when I moved the state to redux, so it will be back in the next few commits).
You can copy/paste images to there, and write with markdown / latex, which is why I wrote it, since I couldn't find anything that did all those things conveniently.
The stickies poke out a bit, which is where I put a little label to aid searching.
edit: more info
For more technical notes, I use Quiver[1] on OSX for keeping track of research topics, code snippets, walkthroughs and tutorials, guides etc.
[0]: http://gingerlabs.com/ [1]: http://happenapps.com/
EDIT: There's one exception where I write notes from time to time: design notes for hypothetical software. I still have a few text files from a few years back somewhere in a Git repo, where I hypothesized about how my own programming language might look. Rust has stolen most of my ideas, though. :) (There was actually something vaguely similar to the borrow checker in there.)
But the web app had an annoying habit of continually hiding the edit ribbon, making it a chore to use for formatting notes.
Besides my daily lab journal (one org file per month), I have project-specific org files also. This whole notes directory hierarchy is synced everywhere, also to my Android phone where I sometimes use emacs with termux to access these notes.
Searching is done using helm-projectile-ag, which is bound to `C-c p s s`
I use a command-line tool to fill my local couchDB with notes and then just use the gh-pages hosted site to view them / search them.
For all the time I've spent studying computational science, I'm actually very content to be without technology. For instance: I have my most valuable code on github, and as long as I know it's there I know there's no problem if I lose my physical machine. The IP is worth more than the hardware.
However, I can't say the same about notes. I don't keep my notes or writings anywhere on the "cloud." I don't think there's a solution that exists yet that is up-to-snuff for me, but someone did post a site that was made to be notes-for-long-into-the-future recently, perhaps someone with better remembering can find it.
You might be referring to Standard Notes [0], which advertises itself as having a focus on longevity. The discussion on HN [1] mentions many alternatives that are based on plain text.
I've tried solutions like org-mode but I just find thinking on a keyboard to be entirely inadequate for some reason. I end up doing a lot of free-form notes so that might be one reason why.
Also has a nice export tool which I can use should I need to migrate. One downside is markdown is not supported on the mac version from some reason (works on windows/mobile)
Occasionally use Dia diagrams for ideas that map better with such a graphical representation (subsystem interaction and the interfaces of its boundaries).
Anything more temporary than that (AKA brain buffer) goes into a whiteboard or a paper notebook.
For notes, I use something like Google Keep so I can type them out on my phone when I am out. Once a month, I copy to a spiral bound sketchpad.
Quite some time ago I created Labradoc http://labradoc.com/ to help make the process easier for myself & others and make myself incredibly wealthy through SaaS. While the latter has not happened, :) the site has still been super valuable for me: http://www.labradoc.com/i/follower (I started my journey by using a single-file wiki tool: http://code.rancidbacon.com/ProjectLogArduinoUSB .)
It hasn't had any feature (or design :) ) upgrades for...about half a decade and while there are many things I've thought of adding it serves my purposes in its current state.
While the past couple of years has seen the development of "project log" sites for hackers/developers the general note-taking approach seems less common. Part of the reason being that I suspect most developers are inclined to just build their own.
Here's an example of a completed project log: http://www.labradoc.com/i/follower/p/project-sms-text-scroll...
In addition to "project" logs I also have "topic" notes (e.g. http://www.labradoc.com/i/follower/p/notes-web-bluetooth & http://www.labradoc.com/i/follower/p/notes-react-native) which tend to be a collection of reference links and then chronological notes related to my work on the topic.
Here's some links to other posts about this subject & site which may be of interest:
* "Show HN: Side project this weekend? Start a Labradoc project log to keep track.": https://news.ycombinator.com/item?id=2669425
* https://news.ycombinator.com/item?id=2914071
* https://news.ycombinator.com/item?id=4213311
And other random comments on the topic I've made:
* "I've found a project log as a good way to get an idea out of my head too--or out of the tabs in my browser :) until I'm ready to get back to it."
* "I consider it a form of a "commit log for your day"..."
* "The single biggest thing that's helped me context switch between projects (or return to one) has been keeping a project log. To me, a project log is to documentation as Twitter is to blogging--it requires little effort but over time provides useful pointers to where you were at the time."
* "Yeah, it's really helped with those 'now, what was that command line I used?' and 'how did I solve that problem last time?' type questions too. And not just for yourself. It also helps other people pick up 'incomplete' projects you might have lying around that you cough haven't got around to documenting yet."
touch ideas