Sharing code is awesome and it's more awesome when you tell people what they can and can't do with your source code,
You can add a license by adding a license.txt file or simply referring the license name.
ChooseALicense.com could be useful choosing right license.
You are not forced to choose a license. But if you don't mention any license, default copyright laws of shareablecode contents applies.
Default License For Text Content
By default, you retain all rights to your text contents( i.e title, paragraph, lists etc), media (if any) that you've used to describe your code in the post section. No one should reproduce, distribute of your text content.
Default License For Source Code
We want to keep source code open to use for anyone. If you do not add/reference any license in your post,
by default MIT
license will be applicable to your source code files as well as code blocks in posts and comments.