A little while ago I provided an answer on Stackoverflow that someone liked and asked me via private email if he could use portions of it in production code, which I was happy for him to do.

What is the best way for me to licence any original code I may post here so that people may use it without needing to contact me specifically. In my commment area on my profile? Maybe we could have a Licence terms section of our profile?


Anything you post on StackOverflow and its sister sites is automatically placed under a Creative Commons license. As such, all anyone needs to do to use the content is to follow the terms of that license. However, since the person requested to use your code in a production codebase that likely cannot be placed under a Creative Commons license (as is required by the license) then they will have to contact the owner of the content (in this case, you) to obtain a different license. Unfortunately, there is no mechanism built into StackOverflow for contacting another user (yet).

Alternatively, if you wish to dual-license (GPL, public domain, etc) your content here, you can put an appropriate note in your "About Me" section of your profile and people can choose the license under which they wish to use your content. Note that this will only apply to content you create - if you edit an answer, that answer cannot be relicensed without that owner's consent as well.

  • "...people can choose the license they wish to use your content under." should read, "...people can choose the license under which they wish to use your content." – raven Jul 5 '09 at 3:46

See: this question on SO.

Some of us, have started putting a snippet, to this effect, in our profile page.

All original code samples I post here are given freely to the public domain on an "as is" basis, but no warranty is given (implied or assumed) etc - you know the drill...

It makes code samples much easier to share. Note, public domain is not really a license.

  • The is no such thing as the public domain. If you want to grant a permissive license (Apache, BSD, etc) link to it. – Rosinante Jul 15 '12 at 17:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .