Joplin works well for me, I started using it as an Evernote replacement half a year ago. It's open source, has markdown, syntax highlighting for many languages, comes with a mobile and desktop app and syncs via various services, e.g. Dropbox.
+1 for Joplin, I use it for logging my work day. I dump the information in JIRA task I work on and have highlights and other related notes in Joplin, although I wish Joplin has a native support for calendar (similar to https://zim-wiki.org).