Writing code

Type command-shift-c to enter code or use the toolbar.

Code blocks via rich text editor

Selecting Insert->Code Block, you can insert longer snippets of code (with automatic syntax highlighting!). For example: