You could look at doing your note taking using iPython/Jupyter Notebooks.
- Full Markdown Support in several flavours
- MathJax for equations.
- HTML support
- Not quite WYSIWYG but as soon as you move on to the next cell the cell that you have been working on is rendered.
- Embed local or remote files
- Code snippets in hundreds of programming languages with full syntax highlighting
- Can also embed data from the web
- Can generate charts, (including based on live web data)
- Code only cells can also be executed and the resulting output displayed in multiple programming languages, (depending what you have installed), including python (default), Julia, R, Bash, Haskell, Ruby, Perl.
- Save to ipython notebooks and export to Markdown, HTML, reST or pdf.
- Automatically saves your work in progress every few minutes
- Allows reverting to specific checkpoint.
- Free - gratis & open source
- Runs on multiple platforms including OS-X, Windows, Linux
An example showing some of the features: