diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
new file mode 100644
index 00000000..9b331881
--- /dev/null
+++ b/.github/CODEOWNERS
@@ -0,0 +1,31 @@
+# ---------- Our awesome maintainers ----------
+
+# Global maintainers
+* @Mathys-Gasnier
+
+# Code maintainers
+/src/ @psychlone77 @saminjay @Mathys-Gasnier
+
+# Snippets maintainers
+/snippets @majvax @Mathys-Gasnier
+/snippets/javascript @psychlone77 @saminjay
+/snippets/python @psychlone77 @saminjay
+/snippets/cpp @saminjay
+
+
+# ---------- What is a maintainer ----------
+
+# Maintainers will be notified when there is a pull request
+# with a change in the folder/file assigned to them. They will
+# have to approve the pull request before it can be merged.
+
+
+# ---------- How to be a maintainer ----------
+
+# To maintain trust and collaboration with reviewers, first,
+# we will need to prove that you can contribute to the project well.
+# As you contribute more, the more responsibility you will have.
+
+# We will assign maintainers for specific languages as well.
+# As we notice more contribution from your side, we will let you know
+# and assign you a language.
\ No newline at end of file
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
new file mode 100644
index 00000000..b03120fc
--- /dev/null
+++ b/.github/FUNDING.yml
@@ -0,0 +1,15 @@
+# These are supported funding model platforms
+
+github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
+patreon: # Replace with a single Patreon username
+open_collective: # Replace with a single Open Collective username
+ko_fi: technoph1le
+tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
+community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
+liberapay: # Replace with a single Liberapay username
+issuehunt: # Replace with a single IssueHunt username
+lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
+polar: # Replace with a single Polar username
+buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
+thanks_dev: # Replace with a single thanks.dev username
+custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
diff --git a/.github/ISSUE_TEMPLATE/bugs.yml b/.github/ISSUE_TEMPLATE/bugs.yml
new file mode 100644
index 00000000..b5d03625
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bugs.yml
@@ -0,0 +1,15 @@
+name: "Bug Report"
+description: "File a bug report to fix issues in the codebase"
+title: "[Bug] - "
+labels: ["bug"]
+body:
+ - type: markdown
+ attributes:
+ value: "# Bug report"
+ - type: textarea
+ id: description
+ attributes:
+ label: "What bug did you find in the codebase?"
+ description: "Please explain the issue in as much detail as possible. Provide screenshots as necessary"
+ validations:
+ required: true
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 00000000..3ba13e0c
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1 @@
+blank_issues_enabled: false
diff --git a/.github/ISSUE_TEMPLATE/docs.yml b/.github/ISSUE_TEMPLATE/docs.yml
new file mode 100644
index 00000000..1c4c2011
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/docs.yml
@@ -0,0 +1,15 @@
+name: Documentation
+description: Request to update documentation or fix typos
+title: "[Docs] - "
+labels: ["documentation"]
+body:
+ - type: markdown
+ attributes:
+ value: "# Update documentation"
+ - type: textarea
+ id: docs
+ attributes:
+ label: What changes would you like to make in the documentation?
+ description: Please explain the issue and what the change should be
+ validations:
+ required: true
diff --git a/.github/ISSUE_TEMPLATE/features.yml b/.github/ISSUE_TEMPLATE/features.yml
new file mode 100644
index 00000000..3f77f087
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/features.yml
@@ -0,0 +1,13 @@
+name: Feature request
+description: Request for feature
+title: "[Feature] - "
+labels: ["feature"]
+body:
+ - type: markdown
+ attributes:
+ value: "# Feature request"
+ - type: textarea
+ id: feature
+ attributes:
+ label: What feature would you like to see?
+ description: Please provide a detailed description for the new feature.
diff --git a/.github/ISSUE_TEMPLATE/general.yml b/.github/ISSUE_TEMPLATE/general.yml
new file mode 100644
index 00000000..6ecf7033
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/general.yml
@@ -0,0 +1,12 @@
+name: General report
+description: This is a general issue that does not fit in the other categories
+title: "[General] - "
+body:
+ - type: markdown
+ attributes:
+ value: "# General"
+ - type: textarea
+ id: description
+ attributes:
+ label: What general issue would you like to create?
+ description: Please be as detailed as possible. Include code snippets or screenshots if necessary.
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
new file mode 100644
index 00000000..977e2ca3
--- /dev/null
+++ b/.github/pull_request_template.md
@@ -0,0 +1,46 @@
+
+
+# Description
+
+
+
+## Type of Change
+
+
+
+- [ ] ✨ New snippet
+- [ ] 🛠 Improvement to an existing snippet
+- [ ] 🐞 Bug fix
+- [ ] 📖 Documentation update
+- [ ] 🔧 Other (please describe):
+
+## Checklist
+
+
+
+- [ ] I have tested my code and verified it works as expected.
+- [ ] My code follows the style and contribution guidelines of this project.
+- [ ] Comments are added where necessary for clarity.
+- [ ] Documentation has been updated (if applicable).
+- [ ] There are no new warnings or errors from my changes.
+
+## Related Issues
+
+
+
+Closes #
+
+## Additional Context
+
+
+
+## Screenshots (Optional)
+
+
+
+Click to view screenshots
+
+
+
+
(predicate))\n | std::ranges::to (predicate))\n | std::ranges::to Typerwriter Animation> zip(List list1, List list2) {\n // Create pairs by iterating through the indices of both lists\n return IntStream.range(0, Math.min(list1.size(), list2.size())) // Limit the range to the smaller list\n .mapToObj(i -> Arrays.asList(list1.get(i), list2.get(i))) // Pair elements from both lists at index i\n .collect(Collectors.toList()); // Collect the pairs into a List\n}\n\n// Usage:\nList
> zipped = zip(arr1, arr2);\n\nSystem.out.println(zipped); // Output: [[a, 1], [b, 2], [c, 3]]\n",
+ "extension": "java"
+ }
+ ]
+ },
+ {
+ "name": "Basics",
+ "snippets": [
+ {
+ "title": "Hello-World",
+ "description": "Prints Hello world in the console",
+ "author": "SarvariHarshitha",
+ "tags": [
+ "java",
+ "console",
+ "printing"
+ ],
+ "contributors": [],
+ "code": "// This is the main class of the Java program\npublic class Main {\n // The main method is the entry point of the program\n public static void main(String args[]) {\n // This statement prints \"Hello, World!\" to the console\n System.out.println(\"Hello, World!\");\n }\n}\n\n",
+ "extension": "java"
+ }
+ ]
+ },
+ {
+ "name": "Bit Manipulation",
+ "snippets": [
+ {
+ "title": "Bit Counting",
+ "description": "Counts the set bits in the binary representation of an integer",
+ "author": "Mcbencrafter",
+ "tags": [
+ "math",
+ "number",
+ "bits",
+ "bit-counting"
+ ],
+ "contributors": [],
+ "code": "public static int countBits(int number) {\n int bits = 0;\n \n while (number > 0) {\n bits += number & 1;\n number >>= 1;\n }\n\n return bits;\n}\n\n// Usage:\nint number = 5;\nSystem.out.println(countBits(5)); // 2 (101)\n",
+ "extension": "java"
+ },
+ {
+ "title": "Is Power Of Two",
+ "description": "Checks if a number is a power of two",
+ "author": "Mcbencrafter",
+ "tags": [
+ "math",
+ "number",
+ "bit",
+ "power-of-two"
+ ],
+ "contributors": [],
+ "code": "public static boolean isPowerOfTwo(int number) {\n return (number > 0) && ((number & (number - 1)) == 0);\n}\n\n// Usage:\nint number = 16;\nSystem.out.println(isPowerOfTwo(number)); // true (2^4)\n",
+ "extension": "java"
+ }
+ ]
+ },
+ {
+ "name": "Date Time",
+ "snippets": [
+ {
+ "title": "Date Time Formatting American",
+ "description": "Formats a timestamp to a human-readable date-time string in the format \"MM/dd/yyyy hh:mm:ss a\"",
+ "author": "Mcbencrafter",
+ "tags": [
+ "date",
+ "time",
+ "date-time",
+ "formatting",
+ "american"
+ ],
+ "contributors": [],
+ "code": "import java.time.Instant;\nimport java.time.ZoneId;\nimport java.time.format.DateTimeFormatter;\nimport java.util.concurrent.TimeUnit;\n\n// using the system default time zone\npublic static String formatDateTimeAmerican(long time, TimeUnit timeUnit) {\n return formatDateTimeAmerican(time, timeUnit, ZoneId.systemDefault());\n}\n\npublic static String formatDateTimeAmerican(long time, TimeUnit timeUnit, ZoneId timeZone) {\n return DateTimeFormatter.ofPattern(\"MM/dd/yyyy hh:mm:ss a\")\n .withZone(\n timeZone != null ? timeZone : ZoneId.systemDefault()\n )\n .format(Instant.ofEpochSecond(\n timeUnit.toSeconds(time)\n ));\n}\n\n// Usage:\nSystem.out.println(formatDateTimeAmerican(1735689599, TimeUnit.SECONDS)); // \"12/31/2024 | 11:59:59 PM\" for GMT+0000\nSystem.out.println(formatDateTimeAmerican(1735689599, TimeUnit.SECONDS, ZoneId.of(\"GMT+0000\"))); // \"12/31/2024 | 11:59:59 PM\"\n",
+ "extension": "java"
+ },
+ {
+ "title": "Date Time Formatting European",
+ "description": "Formats a timestamp to a human-readable date-time string in the format \"dd.MM.yyyy HH:mm:ss\"",
+ "author": "Mcbencrafter",
+ "tags": [
+ "date",
+ "time",
+ "date-time",
+ "formatting",
+ "european"
+ ],
+ "contributors": [],
+ "code": "import java.time.Instant;\nimport java.time.ZoneId;\nimport java.time.format.DateTimeFormatter;\nimport java.util.concurrent.TimeUnit;\n\n// using the system default time zone\npublic static String formatDateTimeEuropean(long time, TimeUnit timeUnit) {\n return formatDateTimeEuropean(time, timeUnit, ZoneId.systemDefault());\n}\n\npublic static String formatDateTimeEuropean(long time, TimeUnit timeUnit, ZoneId timeZone) {\n return DateTimeFormatter.ofPattern(\"dd.MM.yyyy HH:mm:ss\")\n .withZone(\n timeZone != null ? timeZone : ZoneId.systemDefault()\n )\n .format(Instant.ofEpochSecond(\n timeUnit.toSeconds(time)\n ));\n}\n\n// Usage:\nSystem.out.println(formatDateTimeEuropean(1735689599, TimeUnit.SECONDS)); // \"31.12.2024 | 23:59:59\" for GMT+0000\nSystem.out.println(formatDateTimeEuropean(1735689599, TimeUnit.SECONDS, ZoneId.of(\"GMT+0000\"))); // \"31.12.2024 | 23:59:59\"\n",
+ "extension": "java"
+ },
+ {
+ "title": "Duration Formatting Hours Minutes Seconds",
+ "description": "Converts a given time duration to a human-readable string in the format \"hh:mm(:ss)\"",
+ "author": "Mcbencrafter",
+ "tags": [
+ "time",
+ "formatting",
+ "hours",
+ "minutes",
+ "seconds"
+ ],
+ "contributors": [],
+ "code": "import java.util.concurrent.TimeUnit;\n \npublic static String formatDurationToHoursMinutesAndSeconds(int time, TimeUnit timeUnit, boolean showSeconds) {\n long totalSeconds = timeUnit.toSeconds(time);\n\n if (totalSeconds < 0)\n throw new IllegalArgumentException(\"Duration must be a non-negative value.\");\n\n // These variables can be directly used in the return statement,\n // but are kept as separate variables here for better readability.\n long hours = totalSeconds / 3600;\n long minutes = (totalSeconds % 3600) / 60;\n long seconds = totalSeconds % 60;\n\n if (showSeconds) {\n return String.format(\"%02d:%02d:%02d\", hours, minutes, seconds);\n } else {\n return String.format(\"%02d:%02d\", hours, minutes);\n }\n}\n\n// Usage:\nSystem.out.println(formatDurationToHoursMinutesAndSeconds(3810, TimeUnit.SECONDS, true)); // \"01:03:30\"\nSystem.out.println(formatDurationToHoursMinutesAndSeconds(3810, TimeUnit.SECONDS, false)); // \"01:03\"\n",
+ "extension": "java"
+ },
+ {
+ "title": "Duration Formatting Minutes Seconds",
+ "description": "Converts a given time duration to a human-readable string in the format \"mm:ss\"",
+ "author": "Mcbencrafter",
+ "tags": [
+ "time",
+ "formatting",
+ "minutes",
+ "seconds"
+ ],
+ "contributors": [],
+ "code": "import java.util.concurrent.TimeUnit;\n\npublic static String formatDurationToMinutesAndSeconds(int time, TimeUnit timeUnit) {\n long totalSeconds = timeUnit.toSeconds(time);\n\n if (totalSeconds < 0)\n throw new IllegalArgumentException(\"Duration must be a non-negative value.\");\n\n // These variables can be directly used in the return statement,\n // but are kept here as separate variables for better readability.\n long minutes = totalSeconds / 60;\n long seconds = totalSeconds % 60;\n\n return String.format(\"%02d:%02d\", minutes, seconds);\n}\n\n// Usage:\nSystem.out.println(formatDurationToMinutesAndSeconds(120, TimeUnit.SECONDS)); // \"02:00\"\nSystem.out.println(formatDurationToMinutesAndSeconds(75, TimeUnit.SECONDS)); // \"01:15\"\n",
+ "extension": "java"
+ }
+ ]
+ },
+ {
+ "name": "Math",
+ "snippets": [
+ {
+ "title": "Checksum",
+ "description": "Calculates the checksum of an int",
+ "author": "Mcbencrafter",
+ "tags": [
+ "math",
+ "number",
+ "checksum"
+ ],
+ "contributors": [],
+ "code": "public static int checksum(int number) {\n number = Math.abs(number);\n int sum = 0;\n\n while (number != 0) {\n sum += number % 10;\n number /= 10;\n }\n\n return sum;\n}\n\n// Usage:\nint number = 12345;\nSystem.out.println(checksum(number)); // 15 = 1+2+3+4+5\n",
+ "extension": "java"
+ },
+ {
+ "title": "Factorial",
+ "description": "Computes the factorial of a given number",
+ "author": "Mcbencrafter",
+ "tags": [
+ "math",
+ "number",
+ "factorial"
+ ],
+ "contributors": [],
+ "code": "import java.math.BigInteger;\n\npublic static BigInteger factorial(int number) {\n BigInteger result = BigInteger.ONE;\n\n for (int currentNumber = 1; currentNumber <= number; currentNumber++) {\n result = result.multiply(BigInteger.valueOf(currentNumber));\n }\n\n return result;\n}\n\n// Usage:\nint number = 6;\nSystem.out.println(factorial(number)); // 720 = 6*5*4*3*2\n",
+ "extension": "java"
+ },
+ {
+ "title": "Fibonacci",
+ "description": "Calculates the nth fibonacci number",
+ "author": "Mcbencrafter",
+ "tags": [
+ "math",
+ "number",
+ "fibonacci"
+ ],
+ "contributors": [],
+ "code": "public static int fibonacci(int number) {\n if (number <= 1) \n return number;\n \n return fibonacci(number - 1) + fibonacci(number - 2);\n}\n\n// Usage:\nint number = 5;\nSystem.out.println(fibonacci(number)) // 3 (0, 1, 1, 2, 3)\n",
+ "extension": "java"
+ },
+ {
+ "title": "Greatest Common Divisor",
+ "description": "Calculates the greatest common divisor (gcd) of two numbers",
+ "author": "Mcbencrafter",
+ "tags": [
+ "math",
+ "number",
+ "greatest-common-devisor",
+ "gcd",
+ "euclidean-algorithm"
+ ],
+ "contributors": [],
+ "code": "public static int gcd(int number1, int number2) {\n while (number2 != 0) {\n int remainder = number2;\n number2 = number1 % number2;\n number1 = remainder;\n }\n\n return number1;\n}\n\n// Usage:\nint a = 16;\nint b = 12;\nSystem.out.println(gcd(a, b)); // 4\n",
+ "extension": "java"
+ },
+ {
+ "title": "Least Common Multiple",
+ "description": "Calculates the least common multiple (lcm) of two numbers",
+ "author": "Mcbencrafter",
+ "tags": [
+ "math",
+ "number",
+ "least-common-multiple",
+ "lcm",
+ "euclidean-algorithm"
+ ],
+ "contributors": [],
+ "code": "public static int lcm(int number1, int number2) {\n int gcdNumber1 = number1;\n int gcdNumber2 = number2;\n \n while (gcdNumber2 != 0) {\n int remainder = gcdNumber2;\n gcdNumber2 = gcdNumber1 % gcdNumber2;\n gcdNumber1 = remainder;\n }\n \n return (number1 / gcdNumber1) * number2;\n}\n\n// Usage:\nint a = 16;\nint b = 12;\nSystem.out.println(lcm(a, b)); // 48\n",
+ "extension": "java"
+ },
+ {
+ "title": "Prime Check",
+ "description": "Checks if a number is a prime",
+ "author": "Mcbencrafter",
+ "tags": [
+ "math",
+ "number",
+ "prime"
+ ],
+ "contributors": [],
+ "code": "public static boolean isPrime(int number) {\n if (number <= 1) \n return false;\n\n if (number <= 3) \n return true;\n\n boolean prime = true;\n for (int divisor = 3; divisor < number; divisor++) {\n if (number % divisor != 0)\n continue;\n\n prime = false;\n break;\n }\n\n return prime;\n}\n\n// Usage:\nint number = 31;\nSystem.out.println(isPrime(number)); // true\n",
+ "extension": "java"
+ }
+ ]
+ },
+ {
+ "name": "String Manipulation",
+ "snippets": [
+ {
+ "title": "Ascii To String",
+ "description": "Converts a list of ascii numbers into a string",
+ "author": "Mcbencrafter",
+ "tags": [
+ "string",
+ "ascii",
+ "encoding",
+ "decode",
+ "conversion"
+ ],
+ "contributors": [],
+ "code": "import java.util.List;\n\npublic static String asciiToString(List
Hello, World!
\n