I'm running a site about web hosting. To improve on my SEO, I started a blog under blog.examplehost.com
Can I post content related to development and code snippets in my blog? Or should I only post content related to web hosting?
In your blog, you can put all information you want but the best is to put information related to web hosting. That way, you can put "relevant" links pointing to your main site. Links will be more natural.
Now, if you have difficulties to put information on web hosting only, you can put information about other activities but stay closed to web hosting. That way, you can diversify your keywords.