When I take notes (usually in class, as I'm still sadly a uni student), I mainly take them on my computer, using a markdown-like syntax on a tool I created that sends everything in a builtin postgreSQL database (that syncs itself with my server every time I connect the laptop to internet). Every note is identified by a unique identifier like "<day><month><year><document number><document type><category>", for example, my latest economy course was noted "0710161CECO", making it kinda weird to others, but crystal clear to me. But as I take notes on paper too (due to professors forbiding us the use of a laptop in class) (completely stupid as these classes are about linux and C development) I write the code on the top right corner of the paper, usually with a small cat drawn (as I love cats)