Intellectual Property of Stack Exchange posts
<p>I sometime post code to StackExchange sites like StackOverflow or CodeReview. To meet the requirements of the site you often have to post full code to get help. This is often code I would like to later publish to certain sites for sale.</p>

<p>When I do this I am always quite worried that my code is now visible to millions of people that could simply copy/paste my code into a notepad file and have the same product as me, completely devaluing mine. </p>

<p>As far as I know once your idea/product is made public in a timestampable way it is considered intellectual property. But how does that hold up when you freely post it to a knowledge sharing site like this that you cannot include licenses on. Even if it were determined that it were your own intellectual property would it be a worthy cause to fight for when the code might make you a few hundred dollars if anything?</p>

<p>From the SE ToS, which is probably relevant:</p>

<blockquote>
  <h2>3. Subscriber Content</h2>
  
  <p>You agree that all Subscriber Content that You contribute to the Network is perpetually and irrevocably licensed to Stack Exchange under the Creative Commons Attribution Share Alike license. You grant Stack Exchange the perpetual and irrevocable right and license to use, copy, cache, publish, display, distribute, modify, create derivative works and store such Subscriber Content and, except as otherwise set forth herein, to allow others to do so in any medium now known or hereinafter developed (“Content License”) in order to provide the Services, even if such Subscriber Content has been contributed and subsequently removed by You. Subscriber warrants, represents and agrees Subscriber has the right to grant Stack Exchange and the Network the rights set forth above. Subscriber represents, warrants and agrees that it will not contribute any Subscriber Content that (a) infringes, violates or otherwise interferes with any copyright or trademark of another party, (b) reveals any trade secret, unless Subscriber owns the trade secret or has the owner’s permission to post it, (c) infringes any intellectual property right of another or the privacy or publicity rights of another, (d) is libelous, defamatory, abusive, threatening, harassing, hateful, offensive or otherwise violates any law or right of any third party, (e) contains a virus, trojan horse, worm, time bomb or other computer programming routine or engine that is intended to damage, detrimentally interfere with, surreptitiously intercept or expropriate any system, data or information, or (f) remains posted after Subscriber has been notified that such Subscriber Content violates any of sections (a) to (e) of this sentence. Stack Exchange reserves the right to remove any Subscriber Content from the Network, re-post to the Network any Subscriber Content removed by any Subscriber or former Subscriber, suspend or terminate Subscriber’s right to use the Services at any time, or pursue any other remedy or relief available to Stack Exchange and/or the Network under equity or law, for any reason (including, but not limited to, upon receipt of claims or allegations from third parties or authorities relating to such Subscriber Content or if Stack Exchange is concerned that Subscriber may have breached the immediately preceding sentence), or for no reason at all.</p>
  
  <p>In the event that You post or otherwise use Subscriber Content outside of the Network or Services, with the exception of content entirely created by You, You agree that You will follow the attribution rules of the Creative Commons Attribution Share Alike license as follows:</p>
  
  <p>You will ensure that any such use of Subscriber Content visually displays or otherwise indicates the source of the Subscriber Content as coming from the Stack Exchange Network. This requirement is satisfied with a discreet text blurb, or some other unobtrusive but clear visual indication.
  You will ensure that any such Internet use of Subscriber Content includes a hyperlink directly to the original question on the source site on the Network (e.g., <a href="https://stackoverflow.com/questions/12345">https://stackoverflow.com/questions/12345</a>)
  You will ensure that any such use of Subscriber Content visually display or otherwise clearly indicate the author names for every question and answer so used.
  You will ensure that any such Internet use of Subscriber Content Hyperlink each author name directly back to his or her user profile page on the source site on the Network (e.g., <a href="https://stackoverflow.com/users/12345/username">https://stackoverflow.com/users/12345/username</a>), directly to the Stack Exchange domain, in standard HTML (i.e. not through a Tinyurl or other such indirect hyperlink, form of obfuscation or redirection), without any “nofollow” command or any other such means of avoiding detection by search engines, and visible even with JavaScript disabled.</p>
</blockquote>

<p>So yes, people can reuse your code, so long as they put it under the same license terms as SE granted it to them under.</p>

intellectual-property