- Choose a snippet that answers a specific question (preferable unanswered)
- Make sure your snippet is modular and reusable
- Rename the variables to make their context clearer.
- Add comments to your snippets
- Test your code! Does the snippet really work.
- State the frameworks it needs.
- Example usage. In code comments is ok.
- Example results. In code comments is ok.
Announcement: READ THIS FIRST- SNIPPET GUIDELINES
Here are some guidelines when submitting snippets. Adhering to these guidelines will increase the likelihood that your snippet will be approved. Reasons your snippets may be disapproved include simply demonstrating basic syntax or library functionality readily available in the documentation, lack of clarity as to usage/importance of the snippet, or incorrect code.