If you are writing a question about how to perform a certain task and then you answer with your solution, that is alright (although there is a community backlash against that in some circles).
But if all you want to do is post "Hey I made this code, here have it!" that is sure to get closed because it wouldn't be treated like a question.
As far as the FAQ is concerned, answering your own question is okie dokie, even if you are only asking the question to begin with so that you can get your code out there. As long as it's a legit question (something that somebody else may at some point may be asking) it is fine. If you post material which can be attributed as spam (such as a link to your own product or to your own site instead of providing the necessary code on your answer) it will probably be dealt with even more harshly.
Some people on StackOverflow and the other sites do not act kindly towards questions that are immediately answered by the OP because they don't look legit (even if they have good intent), so don't expect to get a parade thrown in your favor or a mass of upvotes for your trouble. That's just the way it is.