You surround your code in backticks ` `` ` (`like this`)

Or for block code, you indent your code by four spaces:

    function test()
    {
        alert("it works!")
    }

You can view the source for this post [here](https://meta.stackoverflow.com/revisions/fb8fd8fe-a447-45a7-93af-aea7fd22b2b5/view-source).