Full Stack Docusaurus Knowledge Base

website·Indexed 29 days ago

https://slhmy.github.io/full-stack-docusaurus/

A comprehensive full-stack development knowledge base featuring guides on algorithms, data structures, and language basics for Python and C++. The documentation includes problem solutions, database concurrency and consistency issues, and practical tips for using Docusaurus, MDX, and i18n.

Tokens
2.8K
Snippets
13
Records
24
Agent score
74%

What's inside Full Stack Docusaurus

  1. Overview of the Full-Stack Development Knowledge Base

    The Full-Stack Development Knowledge Base is an open-source resource designed to help developers bridge the gap between theoretical knowledge and practical application. It is organized into three primary sections:

    • Development (开发): General foundational knowledge applicable to exams, interviews, and real-world development.
    • Algorithms (算法): General foundational knowledge applicable to exams, interviews, and real-world development.
    • Blog (博客): Personal explorations and insights.

    The site includes a fully functional search feature to help users quickly locate specific content.

  2. Customize Docusaurus layouts using React

    Docusaurus is powered by React, allowing developers to extend or customize the website layout. You can create custom components or modify the site structure while maintaining the existing header and footer.
  3. Extend and customize Docusaurus layouts with React

    Docusaurus is powered by React, enabling developers to extend or customize the website layout. This allows for the creation of custom components or pages while maintaining the consistency of the global header and footer.
  4. Understand HashMap data structure and time complexity

    A HashMap is a data structure that allows element access using an index (key), which can be of any type, though typically integers or strings are used. Because the index maps directly to the element's memory address, access operations are performed with a time complexity of O(1). The efficiency and behavior of a HashMap depend heavily on the implementation of its hash function.
  5. Get started with Docusaurus documentation

    Docusaurus is designed for quick installation and setup. To begin building your website, place your documentation files into the docs directory, allowing the framework to handle the underlying site structure and chores.
  6. Contribute to the Full-Stack Development Knowledge Base

    The knowledge base is open-source and accepts contributions via GitHub. While the 'Edit this page' button is available, it currently links to the English version of the source code. Contributors wishing to produce content in other languages should have a basic understanding of Docusaurus. Collaboration is encouraged through GitHub issues and discussions.
    # Source code repository
    https://github.com/slhmy/full-stack-docusaurus
  7. Set up Obsidian for Git-based knowledge base synchronization

    To use Obsidian as a frontend for a Git-based knowledge base while maintaining cross-device editing (Mobile/Pad), use the following approach:

    1. Use iCloud to achieve a smooth cross-device editing experience.
    2. Install and use Git plugins within Obsidian to handle version control.
    3. For complex synchronization scenarios, use pure Git operations.
    4. Deploy the content to a repository configured with GitHub Actions for automated deployment.
  8. Get started with Docusaurus documentation

    Docusaurus is designed for quick installation and setup. To begin building your website, place your documentation files into the docs directory; Docusaurus handles the underlying site structure and chores, allowing you to focus on content creation.
  9. Choose between std::vector and std::array in C++

    In C++, prefer std::vector and std::array over C-style arrays because they provide better safety and bounds checking (via the at(idx) method).

    • Use std::vector when you need a dynamic-size array. It is stored on the heap.
    • Use std::array when you need a fixed-size array. It is stored on the stack and generally offers better performance.
  10. Enable 'Edit this page' links for localized content in Docusaurus

    By default, the 'Edit this page' button in Docusaurus may only link to the English version of the source code. To ensure that the button correctly redirects to the source file of the current localized language, you must set the editLocalizedFiles configuration option to true.
    // In docusaurus.config.js
    module.exports = {
      // ...
      preset: 'docusaurus-preset-classic',
      presets: {
        'docusaurus-preset-classic': {
          docs: {
            editLocalizedFiles: true,
          },
        },
      },
    };
  11. Avoid using initialization statements in while loops

    In C++17 and later, the if (init; condition) syntax allows variable initialization within a conditional statement. However, this (init; condition) syntax is not supported in while loops. If you need to initialize a variable that is only used within the scope of a loop and should only be executed once at the start, use a for loop instead, as the init section of a for loop is specifically designed to run once before the first iteration.
  12. Group Anagrams using sorting in Python

    To group anagrams, the core strategy is to create a unique key for each string that is identical for all anagrams. This is achieved by sorting the characters of the string, which removes the order information and compresses the string into a canonical form. A dictionary is then used to map these sorted keys to lists of their corresponding original strings.
    class Solution:
        def groupAnagrams(self, strs: List[str]) -> List[List[str]]:
            d = {}
            for s in strs:
                # Sorting the string to create a unique key for all anagrams
                # Using "".join(sorted(s)) is generally faster than tuple(sorted(s))
                key = "".join(sorted(s))
                d[key] = d.get(key, []) + [s]
            return list(d.values())