Skip to content

Commit 8f31484

Browse files
committed
Removed dist from .gitignore (for testing)
1 parent 7880696 commit 8f31484

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+8139
-2
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
node_modules/
2-
dist/
1+
node_modules/

backend/data/consolidated/_index.json

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
[
2+
{
3+
"name": "BASH",
4+
"icon": "https://api.quicksnip.dev/icons/bash.svg",
5+
"subLanguages": []
6+
},
7+
{
8+
"name": "C",
9+
"icon": "https://api.quicksnip.dev/icons/c.svg",
10+
"subLanguages": []
11+
},
12+
{
13+
"name": "CPP",
14+
"icon": "https://api.quicksnip.dev/icons/cpp.svg",
15+
"subLanguages": []
16+
},
17+
{
18+
"name": "CSHARP",
19+
"icon": "https://api.quicksnip.dev/icons/csharp.svg",
20+
"subLanguages": []
21+
},
22+
{
23+
"name": "CSS",
24+
"icon": "https://api.quicksnip.dev/icons/css.svg",
25+
"subLanguages": []
26+
},
27+
{
28+
"name": "HASKELL",
29+
"icon": "https://api.quicksnip.dev/icons/haskell.svg",
30+
"subLanguages": []
31+
},
32+
{
33+
"name": "HTML",
34+
"icon": "https://api.quicksnip.dev/icons/html.svg",
35+
"subLanguages": []
36+
},
37+
{
38+
"name": "JAVA",
39+
"icon": "https://api.quicksnip.dev/icons/java.svg",
40+
"subLanguages": []
41+
},
42+
{
43+
"name": "JAVASCRIPT",
44+
"icon": "https://api.quicksnip.dev/icons/javascript.svg",
45+
"subLanguages": [
46+
{
47+
"name": "REACT",
48+
"icon": "https://api.quicksnip.dev/icons/javascript--react.svg"
49+
}
50+
]
51+
},
52+
{
53+
"name": "PYTHON",
54+
"icon": "https://api.quicksnip.dev/icons/python.svg",
55+
"subLanguages": [
56+
{
57+
"name": "FASTAPI",
58+
"icon": "https://api.quicksnip.dev/icons/python--fastapi.svg"
59+
},
60+
{
61+
"name": "TKINTER",
62+
"icon": "https://api.quicksnip.dev/icons/python--tkinter.svg"
63+
}
64+
]
65+
},
66+
{
67+
"name": "REGEX",
68+
"icon": "https://api.quicksnip.dev/icons/regex.svg",
69+
"subLanguages": []
70+
},
71+
{
72+
"name": "RUBY",
73+
"icon": "https://api.quicksnip.dev/icons/ruby.svg",
74+
"subLanguages": []
75+
},
76+
{
77+
"name": "RUST",
78+
"icon": "https://api.quicksnip.dev/icons/rust.svg",
79+
"subLanguages": []
80+
},
81+
{
82+
"name": "SCSS",
83+
"icon": "https://api.quicksnip.dev/icons/scss.svg",
84+
"subLanguages": []
85+
},
86+
{
87+
"name": "TYPESCRIPT",
88+
"icon": "https://api.quicksnip.dev/icons/typescript.svg",
89+
"subLanguages": []
90+
}
91+
]

backend/data/consolidated/bash.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[
2+
{
3+
"name": "System",
4+
"snippets": [
5+
{
6+
"title": "Kill Previous Instances",
7+
"description": "Kill all previous instances of a script",
8+
"author": "saminjay",
9+
"tags": ["kill", "process", "background"],
10+
"contributors": [],
11+
"code": "function kill_prev() {\n # $$ contains current pid (grep ignore so it doesn't suicide)\n local processes\n readarray -t processes < <(pgrep -f \"$0\" | grep -v \"$$\")\n kill \"${processes[@]}\" >/dev/null 2>&1\n}\n\n# Usage:\n# Add this function to your background running script\n# It will make sure that only one instance of your script is running at a time\nkill_prev\n",
12+
"extension": "bash"
13+
},
14+
{
15+
"title": "System Resource Monitor",
16+
"description": "Monitors system resources (CPU, RAM, disk, users)",
17+
"author": "sponkurtus2",
18+
"tags": ["file", "system"],
19+
"contributors": [],
20+
"code": "system_resources () {\n echo \"CPU Load: $(top -bn1 | grep \"Cpu(s)\" | awk '{print $2}')%\"\n echo \"Memory Used: $(free -m | awk 'NR==2{printf \"%.2f%%\", $3*100/$2}')\"\n echo \"Disk Used: $(df -h / | awk 'NR==2{print $5}')\"\n echo \"Active Users: $(who | wc -l)\"\n}\n\nsystem_resources \"$@\"\n\n# Usage:\nchmod a+x system-resource-monitor.sh # First make it executable for all the users\n\n./system-resource-monitor.sh # It will print the following system resources (CPU, RAM, disk, and active users)\n",
21+
"extension": "bash"
22+
}
23+
]
24+
}
25+
]

backend/data/consolidated/c.json

Lines changed: 252 additions & 0 deletions
Large diffs are not rendered by default.

backend/data/consolidated/cpp.json

Lines changed: 204 additions & 0 deletions
Large diffs are not rendered by default.

backend/data/consolidated/csharp.json

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
[
2+
{
3+
"name": "Basics",
4+
"snippets": [
5+
{
6+
"title": "Hello, World!",
7+
"description": "Prints Hello, World! to the terminal.",
8+
"author": "chaitanya-jvnm",
9+
"tags": ["printing", "hello-world"],
10+
"contributors": [],
11+
"code": "public class Program {\n public static void Main(string[] args) {\n System.Console.WriteLine(\"Hello, World!\");\n }\n}\n",
12+
"extension": "csharp"
13+
}
14+
]
15+
},
16+
{
17+
"name": "Guid Utilities",
18+
"snippets": [
19+
{
20+
"title": "Generate GUID",
21+
"description": "Generates a new GUID",
22+
"author": "chaitanya-jvnm",
23+
"tags": ["guid", "generate"],
24+
"contributors": [],
25+
"code": "public static string GenerateGuid() {\n return Guid.NewGuid().ToString();\n}\n\n// Usage:\nGenerateGuid(); // Returns: 1c4c38d8-64e4-431b-884a-c6eec2ab02cd (Uuid is random)\n",
26+
"extension": "csharp"
27+
},
28+
{
29+
"title": "Validate GUID",
30+
"description": "Checks if a string is a valid GUID.",
31+
"author": "chaitanya-jvnm",
32+
"tags": ["guid", "validate"],
33+
"contributors": [],
34+
"code": "public static bool IsGuid(string str) {\n return Guid.TryParse(str, out _);\n}\n\n// Usage:\nIsGuid(\"1c4c38d8-64e4-431b-884a-c6eec2ab02cd\"); // Returns: true\nIsGuid(\"quicksnip\"); // Returns: false\n",
35+
"extension": "csharp"
36+
}
37+
]
38+
},
39+
{
40+
"name": "Jwt Utilities",
41+
"snippets": [
42+
{
43+
"title": "Decode JWT",
44+
"description": "Decodes a JWT.",
45+
"author": "chaitanya-jvnm",
46+
"tags": ["jwt", "decode"],
47+
"contributors": [],
48+
"code": "public static string DecodeJwt(string token) {\n return new JwtSecurityTokenHandler().ReadJwtToken(token).ToString();\n}\n\n// Usage:\nstring token = \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c\";\nDecodeJwt(token); // Returns: \"{\\\"alg\\\":\\\"HS256\\\",\\\"typ\\\":\\\"JWT\\\"}.{\\\"sub\\\":\\\"1234567890\\\",\\\"name\\\":\\\"John Doe\\\",\\\"iat\\\":1516239022}\"\n",
49+
"extension": "csharp"
50+
},
51+
{
52+
"title": "Validate JWT",
53+
"description": "Validates a JWT.",
54+
"author": "chaitanya-jvnm",
55+
"tags": ["jwt", "validate"],
56+
"contributors": [],
57+
"code": "public static bool ValidateJwt(string token, string secret) {\n var tokenHandler = new JwtSecurityTokenHandler();\n var validationParameters = new TokenValidationParameters {\n ValidateIssuerSigningKey = true,\n IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(secret)),\n ValidateIssuer = false,\n ValidateAudience = false\n };\n try {\n tokenHandler.ValidateToken(token, validationParameters, out _);\n return true;\n }\n catch {\n return false\n }\n}\n\n// Usage:\nstring JWT = \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c\";\nstring correctSecret = \"your-256-bit-secret\";\nstring wrongSecret = \"this-is-not-the-right-secret\";\n\nValidateJwt(JWT, correctSecret); // Returns: true\nValidateJwt(JWT, wrongSecret); // Returns: false\n",
58+
"extension": "csharp"
59+
}
60+
]
61+
},
62+
{
63+
"name": "List Utilities",
64+
"snippets": [
65+
{
66+
"title": "Swap items at index",
67+
"description": "Swaps two items at determined indexes",
68+
"author": "omegaleo",
69+
"tags": ["list", "swapping"],
70+
"contributors": [],
71+
"code": "public static IList<T> Swap<T>(this IList<T> list, int indexA, int indexB)\n{\n (list[indexA], list[indexB]) = (list[indexB], list[indexA]);\n return list;\n}\n\nvar list = new List<string>() {\"Test\", \"Test2\"};\n\nlist.Swap(0, 1); // Swaps \"Test\" and \"Test2\" in place\n",
72+
"extension": "csharp"
73+
}
74+
]
75+
},
76+
{
77+
"name": "String Utilities",
78+
"snippets": [
79+
{
80+
"title": "Capitalize first letter",
81+
"description": "Makes the first letter of a string uppercase.",
82+
"author": "chaitanya-jvnm",
83+
"tags": ["string", "capitalize"],
84+
"contributors": [],
85+
"code": "public static string Capitalize(this string str) {\n return str.Substring(0, 1).ToUpper() + str.Substring(1);\n}\n\n// Usage:\n\"quicksnip\".Capitalize(); // Returns: \"Quicksnip\"\n",
86+
"extension": "csharp"
87+
},
88+
{
89+
"title": "Truncate String",
90+
"description": "Cut off a string once it reaches a determined amount of characters and add '...' to the end of the string",
91+
"author": "omegaleo",
92+
"tags": ["string", "truncate"],
93+
"contributors": [],
94+
"code": "public static string Truncate(this string value, int maxChars)\n{\n return value.Length <= maxChars ? value : value.Substring(0, maxChars) + \"...\";\n}\n\n// Usage:\n\"Quicksnip\".Truncate(5); // Returns: \"Quick...\"\n",
95+
"extension": "csharp"
96+
}
97+
]
98+
}
99+
]

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy