Mac: If you're a programmer, you probably have all your notes stored in something like a plain text file or Evernote. If you're looking for something built specifically for coding, Quiver might do the job.
Quiver is built for programmers and allows you to mix text, code and Markdown within a note. You can also edit code in place, create as many notebooks as you want, and change themes for syntax highlighting. Quiver does just about everything you'd expect out of a both a notes app and an IDE. You can also share and collaborate on notes if you're working with a small team.
If you're looking for a notes app that actually allows you to store code and LaTeX cells, Quiver's worth a look. You can check out a free trial from the developer's site below.