From 19c9437c040c2487d5e42e7cc5ccb0b43a29c1c8 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 2 Jan 2025 10:23:39 +0000 Subject: [PATCH 1/9] Update consolidated snippets --- public/icons/csharp.svg | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 public/icons/csharp.svg diff --git a/public/icons/csharp.svg b/public/icons/csharp.svg new file mode 100644 index 00000000..96cf5abc --- /dev/null +++ b/public/icons/csharp.svg @@ -0,0 +1,10 @@ + + + + + + + + + + From 73cbecba2dc42ba08f4903855f1c6a6eddbbca10 Mon Sep 17 00:00:00 2001 From: Gihan Rangana Date: Thu, 2 Jan 2025 21:04:34 +0530 Subject: [PATCH 2/9] Create auto-sync.yml --- .github/workflows/auto-sync.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/auto-sync.yml diff --git a/.github/workflows/auto-sync.yml b/.github/workflows/auto-sync.yml new file mode 100644 index 00000000..dd3fb1e7 --- /dev/null +++ b/.github/workflows/auto-sync.yml @@ -0,0 +1,26 @@ +name: Auto Sync with Main Repo + +on: + push: + branches: + - main + +jobs: + sync: + runs-on: ubuntu-latest + + steps: + - name: Checkout Target Repository + uses: actions/checkout@v2 + with: + repository: gihanrangana/quicksnip + ref: main + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Sync with Main Repository + run: | + git remote add upstream https://github.com/gihanrangana/quicksnip.git + git fetch upstream + git checkout main + git merge upstream/main + git push origin main From 84c58acd978def0f13242f1d47bfac955ddb70c5 Mon Sep 17 00:00:00 2001 From: Gihan Rangana Date: Sat, 4 Jan 2025 22:59:53 +0530 Subject: [PATCH 3/9] Function to convert px to rem --- snippets/scss/typography/px-to-rem-helper.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 snippets/scss/typography/px-to-rem-helper.md diff --git a/snippets/scss/typography/px-to-rem-helper.md b/snippets/scss/typography/px-to-rem-helper.md new file mode 100644 index 00000000..de1fc6ef --- /dev/null +++ b/snippets/scss/typography/px-to-rem-helper.md @@ -0,0 +1,19 @@ +--- +title: Function to convert px to rem +description: This function will convert px values to rem values. +author: gihanrangana +tags: sass,function,pixel,rem,px-to-rem,css +--- + +```scss +@function px-to-rem($px, $base: 16px) { + @return ($px / $base) * 1rem; +} + +// Usage +div { + font-size: px-to-rem(12px); // Output: 0.75rem + padding: px-to-rem(16px); // Output: 1rem + margin: px-to-rem(32px) // Output 2rem +} +``` \ No newline at end of file From 9e89a9ce7fb01d760b3ede3b615c9028dbbbf7b9 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sat, 4 Jan 2025 17:30:12 +0000 Subject: [PATCH 4/9] Update consolidated snippets --- public/consolidated/scss.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/public/consolidated/scss.json b/public/consolidated/scss.json index 498f3665..6a32dd82 100644 --- a/public/consolidated/scss.json +++ b/public/consolidated/scss.json @@ -167,6 +167,21 @@ "contributors": [], "code": "@mixin line-clamp($number) {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: $number;\n overflow: hidden;\n}\n" }, + { + "title": "Function to convert px to rem", + "description": "This function will convert px values to rem values.", + "author": "gihanrangana", + "tags": [ + "sass", + "function", + "pixel", + "rem", + "px-to-rem", + "css" + ], + "contributors": [], + "code": "@function px-to-rem($px, $base: 16px) {\n @return ($px / $base) * 1rem;\n}\n\n// Usage\ndiv {\n font-size: px-to-rem(12px); // Output: 0.75rem\n padding: px-to-rem(16px); // Output: 1rem\n margin: px-to-rem(32px) // Output 2rem\n}\n" + }, { "title": "Text Gradient", "description": "Adds a gradient color effect to text.", From 203a81802e5783aff5c88c7f52e66c9bc78499d7 Mon Sep 17 00:00:00 2001 From: Gihan Rangana Date: Sat, 4 Jan 2025 23:09:57 +0530 Subject: [PATCH 5/9] update title --- snippets/scss/typography/px-to-rem-helper.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/scss/typography/px-to-rem-helper.md b/snippets/scss/typography/px-to-rem-helper.md index de1fc6ef..b292ee12 100644 --- a/snippets/scss/typography/px-to-rem-helper.md +++ b/snippets/scss/typography/px-to-rem-helper.md @@ -1,5 +1,5 @@ --- -title: Function to convert px to rem +title: PX to REM Helper description: This function will convert px values to rem values. author: gihanrangana tags: sass,function,pixel,rem,px-to-rem,css From 80e512971580b9b1f462f7139730d55ab1c493be Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sat, 4 Jan 2025 17:40:14 +0000 Subject: [PATCH 6/9] Update consolidated snippets --- public/consolidated/c.json | 2 +- public/consolidated/scss.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/consolidated/c.json b/public/consolidated/c.json index 1588cd69..a9258611 100644 --- a/public/consolidated/c.json +++ b/public/consolidated/c.json @@ -38,7 +38,7 @@ "numbers" ], "contributors": [], - "code": "#include\nvoid swap(int* num1,int* num2){\n *num1 = *num1 + *num2;\n *num2 = *num1 - *num2;\n *num1 = *num1 - *num2;\n}\n\n// Usage:\nint a = 3,b = 4;\nswap(&a,&b); // simply use printf after this to print swapped values\n" + "code": "#include\nvoid swap(int* num1,int* num2){\n *num1 = *num1 + *num2;\n *num2 = *num1 - *num2;\n *num1 = *num1 - *num2;\n}\n\n// Usage:\nint a = 3,b = 4;\nswap(&a,&b); // swaps the values of the a and b variables\n" } ] } diff --git a/public/consolidated/scss.json b/public/consolidated/scss.json index cc336713..a7ffc666 100644 --- a/public/consolidated/scss.json +++ b/public/consolidated/scss.json @@ -157,7 +157,7 @@ "code": "@mixin line-clamp($number) {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: $number;\n overflow: hidden;\n}\n" }, { - "title": "Function to convert px to rem", + "title": "PX to REM Helper", "description": "This function will convert px values to rem values.", "author": "gihanrangana", "tags": [ From 59a44e6acb86b3fa4b2674c5f484c5887e5d8746 Mon Sep 17 00:00:00 2001 From: Gihan Rangana Date: Sun, 5 Jan 2025 09:36:48 +0530 Subject: [PATCH 7/9] updated the requested changes --- .github/workflows/auto-sync.yml | 26 -------------------- snippets/scss/typography/px-to-rem-helper.md | 4 +-- 2 files changed, 2 insertions(+), 28 deletions(-) delete mode 100644 .github/workflows/auto-sync.yml diff --git a/.github/workflows/auto-sync.yml b/.github/workflows/auto-sync.yml deleted file mode 100644 index dd3fb1e7..00000000 --- a/.github/workflows/auto-sync.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Auto Sync with Main Repo - -on: - push: - branches: - - main - -jobs: - sync: - runs-on: ubuntu-latest - - steps: - - name: Checkout Target Repository - uses: actions/checkout@v2 - with: - repository: gihanrangana/quicksnip - ref: main - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Sync with Main Repository - run: | - git remote add upstream https://github.com/gihanrangana/quicksnip.git - git fetch upstream - git checkout main - git merge upstream/main - git push origin main diff --git a/snippets/scss/typography/px-to-rem-helper.md b/snippets/scss/typography/px-to-rem-helper.md index b292ee12..17e154d0 100644 --- a/snippets/scss/typography/px-to-rem-helper.md +++ b/snippets/scss/typography/px-to-rem-helper.md @@ -2,7 +2,7 @@ title: PX to REM Helper description: This function will convert px values to rem values. author: gihanrangana -tags: sass,function,pixel,rem,px-to-rem,css +tags: function,pixel,rem,px-to-rem --- ```scss @@ -10,7 +10,7 @@ tags: sass,function,pixel,rem,px-to-rem,css @return ($px / $base) * 1rem; } -// Usage +// Usage: div { font-size: px-to-rem(12px); // Output: 0.75rem padding: px-to-rem(16px); // Output: 1rem From bd4f36938342bdc05be6e739aa49f453dcbc6609 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sun, 5 Jan 2025 04:07:11 +0000 Subject: [PATCH 8/9] Update consolidated snippets --- public/consolidated/scss.json | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/public/consolidated/scss.json b/public/consolidated/scss.json index a7ffc666..5a2fbeaa 100644 --- a/public/consolidated/scss.json +++ b/public/consolidated/scss.json @@ -161,15 +161,13 @@ "description": "This function will convert px values to rem values.", "author": "gihanrangana", "tags": [ - "sass", "function", "pixel", "rem", - "px-to-rem", - "css" + "px-to-rem" ], "contributors": [], - "code": "@function px-to-rem($px, $base: 16px) {\n @return ($px / $base) * 1rem;\n}\n\n// Usage\ndiv {\n font-size: px-to-rem(12px); // Output: 0.75rem\n padding: px-to-rem(16px); // Output: 1rem\n margin: px-to-rem(32px) // Output 2rem\n}\n" + "code": "@function px-to-rem($px, $base: 16px) {\n @return ($px / $base) * 1rem;\n}\n\n// Usage:\ndiv {\n font-size: px-to-rem(12px); // Output: 0.75rem\n padding: px-to-rem(16px); // Output: 1rem\n margin: px-to-rem(32px) // Output 2rem\n}\n" }, { "title": "Text Gradient", From 92f1f4f05372ff786adcd978d964b14d83230700 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sun, 5 Jan 2025 04:08:29 +0000 Subject: [PATCH 9/9] Update consolidated snippets --- public/consolidated/cpp.json | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/public/consolidated/cpp.json b/public/consolidated/cpp.json index 6427f04f..81eb1c04 100644 --- a/public/consolidated/cpp.json +++ b/public/consolidated/cpp.json @@ -32,6 +32,23 @@ } ] }, + { + "categoryName": "Debugging", + "snippets": [ + { + "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" + ], + "contributors": [], + "code": "#include \n#include \n\ntemplate \nstd::ostream& operator<<(std::ostream& os, const std::vector& vec) {\n os << \"[\"; \n for (size_t i = 0; i < vec.size(); ++i) {\n os << vec[i]; // Print each vector element\n if (i != vec.size() - 1) {\n os << \", \"; // Add separator\n }\n }\n os << \"]\"; \n return os; // Return the stream\n}\n\n// Usage:\nstd::vector numbers = {1, 2, 3, 4, 5};\nstd::cout << numbers << std::endl; // Outputs: [1, 2, 3, 4, 5]\n\n" + } + ] + }, { "categoryName": "Debuging", "snippets": [