-
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dostonnabotov:main' into snippets-c++
- Loading branch information
Showing
11 changed files
with
275 additions
and
21 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,55 @@ | ||
# Vision for QuickSnip | ||
|
||
Will be updating soon... | ||
## 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
title: Vector Print | ||
description: Overloads the << operator to print the contents of a vector just like in python. | ||
author: Mohamed-faaris | ||
tags: printing,debuging,vector | ||
--- | ||
|
||
```cpp | ||
#include <iostream> | ||
#include <vector> | ||
|
||
template <typename T> | ||
std::ostream& operator<<(std::ostream& os, const std::vector<T>& vec) { | ||
os << "["; | ||
for (size_t i = 0; i < vec.size(); ++i) { | ||
os << vec[i]; // Print each vector element | ||
if (i != vec.size() - 1) { | ||
os << ", "; // Add separator | ||
} | ||
} | ||
os << "]"; | ||
return os; // Return the stream | ||
} | ||
|
||
// Usage: | ||
std::vector<int> numbers = {1, 2, 3, 4, 5}; | ||
std::cout << numbers << std::endl; // Outputs: [1, 2, 3, 4, 5] | ||
|
||
``` |
21 changes: 21 additions & 0 deletions
21
snippets/javascript/color-manipulation/rgb-to-hex-color.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
title: RGB to Hex Color | ||
description: Converts RGB color values to hexadecimal color code. | ||
author: jjcantu | ||
tags: color,conversion | ||
--- | ||
|
||
```js | ||
function rgbToHex(r, g, b) { | ||
const toHex = (n) => { | ||
const hex = n.toString(16); | ||
return hex.length === 1 ? '0' + hex : hex; | ||
}; | ||
|
||
return '#' + toHex(r) + toHex(g) + toHex(b); | ||
} | ||
|
||
// Usage: | ||
console.log(rgbToHex(255, 128, 0)); // Output: "#ff8000" | ||
console.log(rgbToHex(0, 255, 0)); // Output: "#00ff00" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
title: Format File Size | ||
description: Converts bytes into human-readable file size format. | ||
author: jjcantu | ||
tags: format,size | ||
--- | ||
|
||
```js | ||
function formatFileSize(bytes) { | ||
if (bytes === 0) return '0 Bytes'; | ||
|
||
const k = 1024; | ||
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB']; | ||
const i = Math.floor(Math.log(bytes) / Math.log(k)); | ||
|
||
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i]; | ||
} | ||
|
||
// Usage: | ||
console.log(formatFileSize(1234)); // Output: "1.21 KB" | ||
console.log(formatFileSize(1234567)); // Output: "1.18 MB" | ||
``` |
27 changes: 27 additions & 0 deletions
27
snippets/javascript/object-manipulation/deep-clone-object.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
title: Deep Clone Object | ||
description: Creates a deep copy of an object or array without reference. | ||
author: jjcantu | ||
tags: object,clone | ||
--- | ||
|
||
```js | ||
function deepClone(obj) { | ||
if (obj === null || typeof obj !== 'object') return obj; | ||
|
||
const clone = Array.isArray(obj) ? [] : {}; | ||
|
||
for (let key in obj) { | ||
if (Object.prototype.hasOwnProperty.call(obj, key)) { | ||
clone[key] = deepClone(obj[key]); | ||
} | ||
} | ||
|
||
return clone; | ||
} | ||
|
||
// Usage: | ||
const original = { a: 1, b: { c: 2 }, d: [1, 2, 3] }; | ||
const cloned = deepClone(original); | ||
console.log(cloned); // Output: 'original' but cloned | ||
``` |
Oops, something went wrong.