I write down things I've had to look up or research while working, or little snippets which might come in handy in the future.
I also find that writing a tutorial-style post helps me understand new frameworks or concepts better, since I have to make sure I know enough about the subject to be able to explain it.
It's also nice that people read it and recognise you - I've worked at a couple of places now where people have mentioned one of my posts has been helpful.