Skip to content

Commit

Permalink
Merge branch 'dostonnabotov:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
gihanrangana authored Jan 4, 2025
2 parents 9e89a9c + 621db73 commit c76d2fc
Show file tree
Hide file tree
Showing 264 changed files with 1,525 additions and 1,912 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
text eol=lf
7 changes: 5 additions & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
* @Mathys-Gasnier

# Code maintainers
/src/ @psychlone77 @saminjay
/src/ @psychlone77 @saminjay @Mathys-Gasnier

# Snippets maintainers
/snippets @Mathys-Gasnier
/snippets @majvax @Mathys-Gasnier
/snippets/javascript @psychlone77 @saminjay
/snippets/python @psychlone77 @saminjay
/snippets/cpp @saminjay


# ---------- What is a maintainer ----------
Expand Down
4 changes: 3 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<!-- **ANY PULL REQUEST NOT FOLLOWING GUIDELINES OR NOT INCLUDING A DESCRIPTION WILL BE CLOSED !** -->

# Description

<!-- Please include a summary of your changes. -->
<!-- Include a summary of your changes. -->

## Type of Change

Expand Down
38 changes: 38 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## QuickSnip Code of Conduct

QuickSnip is a welcoming and collaborative community for developers to organize, share, and discover code snippets. By participating in QuickSnip, you agree to uphold this code of conduct to maintain a friendly and inclusive environment.

### Short Version

- Be respectful to everyone in the community.
- Avoid harassment, trolling, or spamming.
- Ensure QuickSnip remains a safe and productive space for all.
- Report any inappropriate behavior to [me](mailto:[email protected]), the owner of QuickSnip, or our [Discord team](https://discord.gg/UtJJcnsN).
- No unauthorized bots without prior permission.

---

### Long Version

#### Harassment-Free Environment

We are committed to providing a harassment-free experience for everyone, regardless of gender, gender identity and expression, age, sexual orientation, disability, physical appearance, body size, race, ethnicity, national origin, or religion (or lack thereof). Examples of unacceptable behavior include:

- **Harassment:** Includes sexual language or imagery, deliberate intimidation, stalking, name-calling, unwelcome attention, libel, and malicious hacking or social engineering.
- **Trolling:** Posting inflammatory comments to provoke an emotional response or disrupt discussions.
- **Spamming:** Posting off-topic messages, promoting unrelated products, soliciting donations, advertising jobs or gigs, or flooding discussions with files or text.

#### Reporting Issues

If you experience or witness harassment, trolling, spamming, or any other inappropriate behavior, please report it to [me](mailto:[email protected]), the owner of QuickSnip, or our QuickSnip [Discord team](https://discord.gg/UtJJcnsN). Include details like screenshots and URLs, if possible, to help us address the issue effectively.

I, or the QuickSnip team will review all reports and take appropriate actions, which may include warnings, temporary bans, or permanent removal from the community.

#### Respectful Use of Bots

No bots are allowed within the QuickSnip community without prior written permission from the QuickSnip team. Unauthorized bots will be removed.

#### Final Notes

This code of conduct is inspired by [FreeCodeCamp’s approach](https://www.freecodecamp.org/news/code-of-conduct), emphasizing clarity and friendliness. Let’s work together to make QuickSnip a supportive and productive space for all developers!

76 changes: 65 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,89 @@ You can contribute in two main ways:

## Improving the code

If you have a feature request or want to fix a bug, feel free to:
### How to report bugs

- [Open an Issue](https://github.com/dostonnabotov/quicksnip/issues) to let us know what’s up.
- [Send a Pull Request](https://github.com/dostonnabotov/quicksnip/pulls) with your changes.
If you spot a bug in the codebase or issues with the documentation, please open up a [GitHub issue](https://github.com/dostonnabotov/quicksnip/issues) detailing the problem before creating a PR. Once confirmed with maintainers, you can then create a PR.

### How to propose new features

If you are interested in proposing new features, please open up a new [GitHub discussion](https://github.com/dostonnabotov/quicksnip/discussions) with details for the proposed feature.

Please do not create a PR for a new feature without first discussing it with the maintainers. If you create a PR for a new feature without discussing it first, then your PR will be closed.

---

## Snippets Guidelines

### Snippet Tags

- Tags must describe the snippet with simple word.

Here's an example:

```md
---
title: Convert Number to Currency
description: Converts a number to a currency format with a specific locale.
author: axorax
tags: number,currency
---
```

**Do not use generic keywords or the language itself as a tag `utility` or `javascript`!**

### Snippet Format

**All** snippets should follow the following structure:

- A `code` segment, containing a function with the actual snippet functionnality
- An `example` segement, containing one or more examples of use

Example in javascript:
```js
function example(x) {
return x * 2;
}

// Usage:
example(5) // Returns: 10
```

If your function doesn't return anything just show how to use it. If the result of your function is too complicated to be expressed in a single comment, your snippet is probably too complex to begin with.

### Snippet boundaries

To ensure your snippet isn’t refused, consider these questions:
- **Does the standard library of my language provide an easy way of doing this ?**
- **Does that snippet have a real, and practical use case ?**
- **Could it be split into separate parts to be better understood ?**

If any answer is yes, then your snippet will most likely get rejected.

---

## Adding Snippets

### Adding a New Snippet

To add a new code snippet:
1. **Ensure your snippet match [guidelines](#snippets-guidelines)**

1. **Navigate to the relevant folder:**
2. **Navigate to the relevant folder:**

- Go to the `/snippets` folder in the root directory.
- Locate the folder for the programming language of your snippet, such as `javascript` or `python`.

2. **Choose the correct category:**
3. **Choose the correct category:**

- Within the language folder, find the relevant category folder for your snippet.
- If no suitable category exists, refer to [Adding a New Category](#adding-a-new-category).

3. **Create a markdown file:**
4. **Create a markdown file:**

- Create a new file with a `.md` extension.
- Name the file appropriately, keeping it descriptive and concise.

4. **Add your snippet:**
5. **Add your snippet:**

- Use the following format to structure your snippet:

Expand Down Expand Up @@ -74,11 +128,11 @@ console.log(formatDate(new Date())); // Output: '2024-12-10'
```
````

5. **Use syntax highlighting:**
6. **Use syntax highlighting:**
- Enclose your code with triple backticks (```).
- Specify the language after the first set of backticks for syntax highlighting.

6. **Test your snippet:**
7. **Test your snippet:**
- Ensure your code runs as expected. \
To test that your snippets are formatted correctly use the `snippets:check` script:
```
Expand Down Expand Up @@ -193,6 +247,6 @@ If you want to introduce a new programming language, here's how to do it:

Whether you’re fixing a tiny typo, writing a new snippet, or dreaming up big features, every bit counts! 🛠️

If you have any questions or need help, feel free to open an issue or tag me.
If you have any questions or need help, feel free to open a new [GitHub discussion](https://github.com/dostonnabotov/quicksnip/discussions).

Happy coding! 💻✨
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,15 @@ Be sure to check out the [CONTRIBUTING.md](/CONTRIBUTING.md) file for detailed g

### Improving the code

Got a feature idea or bug fix? Here's how you can contribute:
- **Reporting bugs**

- [Open an issue](https://github.com/dostonnabotov/quicksnip/issues) to share your ideas or report a bug.
- [Send a pull request](https://github.com/dostonnabotov/quicksnip/pulls) with your changes.
- If you spot a bug in the codebase or issues with the documentation, please open up a [GitHub issue](https://github.com/dostonnabotov/quicksnip/issues) detailing the problem before creating a PR.
- Once confirmed with maintainers, you can then create a PR.

- **Proposing new features**

- If you are interested in proposing new features, please open up a new [GitHub discussion](https://github.com/dostonnabotov/quicksnip/discussions) with details for the proposed feature.
- Please do **not** create a PR for a new feature without first discussing it with the maintainers. If you create a PR for a new feature without discussing it first, then your PR will be closed.

### Adding a Snippet

Expand Down Expand Up @@ -99,11 +104,13 @@ For more details about adding new categories or programming languages, check out

To keep things smooth and consistent, please:

- Follow the formatting rules described above.
- Include all mandatory fields in the snippet.
- Test your snippet to ensure it works as expected.
- [x] Follow the style and contribution guidelines of this project.
- [x] Include all mandatory fields in the snippet.
- [x] Test your snippet to ensure it works as expected.

Following these guidelines helps us (and everyone else) review and merge your contributions faster.

Following these guidelines helps me (and everyone else) review and merge your contributions faster.
**If you fail to meet the guidelines, your PR will most likely get rejected.**

## License

Expand Down
55 changes: 55 additions & 0 deletions VISION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Vision for QuickSnip

## What is QuickSnip?

QuickSnip is an open-source tool designed for developers who want to organize, search, and share code snippets. It aims to streamline the coding process by providing a centralized platform for snippet management.

## Core Principles

- **Developer Focused**: Focus on features that truly improve developer productivity.

- **Open and Extensible**: Encourage community contributions and integrations.

- **Lightweight and Fast**: Keep performance high and avoid unnecessary complexity.

## Our Goals

- Seamless snippet management without turning into an overly complex tool

- Enable collaboration and sharing while respecting user privacy and customization needs.

We do **NOT** aim to be:

- a component library
- a documentation

## QuickSnip Roadmap

### v1.0 (Launching Soon)

- [x] A new snippets storage system for better maintainability and scalability
- [ ] Search functionality
- [ ] A support for frameworks and libraries
- [ ] An ability to share snippets with others
- [ ] A basic SEO (Search Engine Optimization)

### v2.0 (Planned Vision)

- [ ] An ability to have private snippets with personal account
- [ ] Improved search functionality with filters
- [ ] An improved SEO (Search Engine Optimization)

### Potential Future Ideas

- [ ] Plugins for IDEs like VS Code and JetBrains
- [ ] Enterprise-grade support for larger organizations

## Disclaimer on Future Plans

This roadmap outlines our current vision for QuickSnip and may evolve based on user feedback, community contributions, and shifting priorities. We welcome your input and encourage you to help shape QuickSnip’s future.

## Future Vision

QuickSnip aims to become the preferred platform for developers to store, retrieve, and collaborate on code snippets.

Explore our [GitHub Releases](https://github.com/dostonnabotov/quicksnip/releases) for updates and join us on this journey.
1 change: 1 addition & 0 deletions cspell-dict.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
quicksnip
slugifyed
73 changes: 41 additions & 32 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { fixupPluginRules } from "@eslint/compat";
import { FlatCompat } from "@eslint/eslintrc";
import js from "@eslint/js";
import globals from "globals";
import reactPlugin from 'eslint-plugin-react';
import reactPlugin from "eslint-plugin-react";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import tseslint from "typescript-eslint";
Expand Down Expand Up @@ -49,46 +49,55 @@ export default tseslint.config(
alwaysTryTypes: true,
},
},
react: {
version: "detect",
},
},
rules: {
...reactHooks.configs.recommended.rules,
"@typescript-eslint/no-empty-object-type": "off",
"@typescript-eslint/no-unused-vars": ["error", {
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}],
"import/order": ["error", {
"groups": [
"builtin",
"external",
"internal",
["parent", "sibling"],
"index",
"object",
"type",
"unknown"
],
"pathGroups": [
{
"pattern": "@*",
"group": "internal",
"position": "after"
}
],
"pathGroupsExcludedImportTypes": ["builtin", "internal"],
"newlines-between": "always",
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}],
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
"import/order": [
"error",
{
groups: [
"builtin",
"external",
"internal",
["parent", "sibling"],
"index",
"object",
"type",
"unknown",
],
pathGroups: [
{
pattern: "@*",
group: "internal",
position: "after",
},
],
pathGroupsExcludedImportTypes: ["builtin", "internal"],
"newlines-between": "always",
alphabetize: {
order: "asc",
caseInsensitive: true,
},
},
],
"react/react-in-jsx-scope": "off",
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
"semi": ["error", "always"],
semi: ["error", "always"],
},
}
);
Loading

0 comments on commit c76d2fc

Please sign in to comment.