Agreed. And not just code. Things you've done, why and how. Sometimes you spend a lot of time searching Google and Stack Exchange to piece together lots of fragments of information. Writing a blog post about it not only helps keep it in one place for yourself if you ever need to refer to it again, if you document the pitfalls you encountered it may even be useful to someone else.