As already pointed out by blahdiblah, all Stack Exchange websites allow you to answer your own question/s.
In fact, in the Stackoverflow FAQ's it specifically says that It’s also OK to ask and answer your own question.
That being said, the community does not always look at it as an honest attempt on the OP's part to genuinely help others (although, that is the point of SE). Unfortunately, nothing can be done about how the community reacts to such situations. I have in the past commented on a question (I tried to hunt that comment down before posting this, but either it is buried in my list of comments, or probably deleted with the question.) that this SO cannot be treated as a blog post. That does contradict the fact that asking and answering your own question is encouraged. However, I said that because the user, in my opinion, was doing this for gaining reputation. His list of questions kinda made me feel that. Some of them were pretty simple questions and mostly duplicates of other questions.
Occasionally, you will also find your own solution and post an answer for it: Android Facebook Post On Wall Without Dialog Warnings
Sometime, things like this will happen too: Is it a desirable action to flag self-answers which are obviously rep farming?.
I my opinion, if you are talking about a few questions (that you would like to answer yourself) now and then that really address something that does not have a clear solution, go right ahead. However, if you are looking at posting several such Q&A's, I would be cautious. SO is community driven, regardless of whether they took it in the right spirit or not. You could consider a blog of your own and link to it in your profile. When a relevant question comes up, link to it again with an excerpt of the necessary code.
If your intention is to genuinely help by sharing your knowledge (keeping blahdiblah suggestions in mind), you could also consider marking your answer as a Community Wiki. This way, no one can accuse you of any wrong doing whatsoever.
My two cents....