A collection of useful code snippets, utilities, and reusable code patterns organized by language and category.
code-snippets/
βββ python/ # Python snippets
βββ javascript/ # JavaScript/Node.js snippets
βββ java/ # Java snippets
βββ cpp/ # C/C++ snippets
βββ bash/ # Bash/Shell scripts
βββ sql/ # SQL queries and database snippets
βββ web/ # HTML/CSS/Web snippets
βββ algorithms/ # Algorithm implementations
βββ data-structures/ # Data structure implementations
βββ utilities/ # General utilities and tools
- Browse: Navigate through the folders to find snippets by language or category
- Search: Use GitHub's search feature to find specific snippets
- Copy: Copy the code snippets you need into your projects
- Contribute: Add your own useful snippets (see Contributing)
Each snippet should be well-documented with:
- Description: What the snippet does
- Usage: How to use it
- Dependencies: Any required libraries or tools
- Example: Sample usage
Contributions are welcome! To add a new snippet:
- Choose the appropriate folder for your snippet
- Create a new file with a descriptive name
- Include clear comments and documentation
- Add a brief description at the top of the file
- Provide usage examples if applicable
- Submit a pull request
- Use descriptive names:
find_duplicates_in_list.pyinstead ofscript1.py - Use underscores for multi-word names
- Include file extension appropriate for the language
Python scripts, functions, and utilities
JavaScript/Node.js code snippets and patterns
Java code examples and utilities
C and C++ code snippets
Shell scripts and command-line utilities
Database queries, stored procedures, and SQL utilities
HTML, CSS, and frontend snippets
Common algorithm implementations
Data structure implementations and examples
Cross-language utilities and tools
Feel free to use these snippets in your projects. Attribution is appreciated but not required.
- Always test snippets before using them in production
- Modify snippets to fit your specific use case
- Keep snippets simple and focused on one task
- Document any modifications you make
Happy Coding! π