fudongdong.com Blog

website·Indexed 30 days ago

https://fudongdong.com

A personal blog featuring a collection of technical notes, tool recommendations, and life experiences. Content includes guides on macOS utilities like Alfred, iTerm2, and Karabiner, Chrome extensions, IntelliJ IDEA plugins (IdeaVim), and technical discussions on topics such as robots.txt, DocumentFragment, and lightProxy configuration, alongside personal reflections on travel, fitness, and daily life.

Tokens
34.7K
Snippets
176
Records
298
Agent score
51%

What's inside fudongdong.com

  1. Overview of ROM technology evolution

    ROM technology has evolved from strictly read-only hardware to rewritable flash storage:

    1. Mask ROM: Data is physically encoded during manufacturing; cannot be changed after production.
    2. PROM (Programmable ROM): Invented in 1956; allows a one-time modification of content using high-voltage pulses.
    3. EPROM (Erasable Programmable ROM): Invented by Intel in 1971; can be erased and reset using strong ultraviolet light.
    4. EEPROM (Electrically Erasable Programmable ROM): Invented in 1972; allows electrical erasure and rewriting. Modern mobile flash storage (including NOR and NAND types) is a derivative of EEPROM.
  2. Overview of LightProxy

    LightProxy is an open-source desktop proxy software developed by the IFE team, built on Electron and whistle. It allows frontend developers to control their development environment by using rules to forward and modify the content of every HTTP request and response, facilitating tasks like package redirection and modification.
  3. Overview of Xiangshan's Xianglu Peak

    Xianglu Peak (香炉峰) is a prominent peak at Xiangshan with an elevation of 575 meters. Due to its steep and difficult climb, it is colloquially known as 'Gui Jian Chou' (鬼见愁). The peak features the Chongyang Pavilion (重阳阁), built in 1983, which serves as a primary observation point for viewing the city of Beijing.
  4. Overview of Karabiner-Elements remapping types

    Karabiner-Elements allows macOS users to modify keyboard mappings through three primary methods:

    1. Simple Modifications: Maps one physical key to another specific key (e.g., mapping the right Command key to Option).
    2. Function Keys: Specifically remaps Fn keys (F1, F2, etc.) to other functions.
    3. Complex Modifications: Handles advanced logic, such as mapping key combinations (e.g., Ctrl+hjkl to arrow keys) or application-specific triggers.
  5. Overview of Meituan Waimai's React-based Micro-Frontend Architecture

    To address engineering complexity and slow build/deployment speeds in a multi-platform environment (PC, H5, and KA), Meituan Waimai implemented a 'Specific Central Routing Base' micro-frontend architecture. This approach splits the system into two primary components:

    1. Base Project (Container): Manages route switching, registers sub-project routes, handles the global Store layer, and provides shared libraries and infrastructure.
    2. Sub-projects: Each corresponds to a specific business line and contains the code for all three platforms (PC, H5, KA) and their shared logic.

    The connection between the base and sub-projects is maintained via a mapping of sub-project entry file addresses and their corresponding route addresses, allowing the base to dynamically load the required resources.

  6. Overview of iShot for macOS

    iShot is a comprehensive utility for macOS that combines six primary tools into one: screen capturing, long screenshots, image pasting (stickers), annotation, color picking, and screen recording.
  7. Overview of ANSI Escape Sequences

    ANSI escape sequences are special character strings used by programs to interact with terminals. They allow a program to control the behavior and styling of the terminal output, such as changing text colors, background colors, and manipulating the cursor position.
  8. Overview of Bombom Space (弹力猩球) Indoor Sports Center

    Bombom Space (弹力猩球) is a comprehensive indoor sports center combining trendy sports, leisure entertainment, dining, and retail. Facilities typically cover approximately 3,000 square meters and are divided into four main areas: Sports Theme Exploration Area, Party/Team Building Area, Retail Peripheral Area, and Parent-Child Sports Restaurant. The Exploration Area features six themes, including trampolines, climbing, speed sliding, and future technology. The center focuses on 'miniaturized' and gamified versions of traditional sports, catering primarily to young people and families (70% of consumers are parent-child groups).
  9. Overview of the Node.js framework evolution from Express to Midway.js

    The ecosystem of Node.js web frameworks has evolved to address specific developer pain points:

    • Express: The earliest popular framework, but faced challenges with 'callback hell' and evolving ECMAScript standards.
    • Koa: Created by the Express team to be a smaller, more expressive foundation. It provides only core web functionality, requiring developers to manually integrate middleware for sessions, routing, and body parsing.
    • Egg.js: Built on top of Koa, it integrates a set of 'best practices' to provide an out-of-the-box experience. It introduces convention-over-configuration, a robust plugin system, and support for multi-thread startup and hot updates.
    • Midway.js: An evolution of Egg.js that leverages TypeScript to introduce Inversion of Control (IoC) and decorators, supporting monolithic applications, serverless, and functional programming.
  10. Use fzf for interactive command-line filtering

    fzf is an interactive Unix command-line tool written in Go. It can be used to search through any list content, including files, command history, hosts, processes, and Git branches. Any command-line tool that generates list output can be piped into fzf for searching.
    brew install fzf
  11. Automate SSH logins with sshpass

    sshpass is a lightweight command-line tool that allows providing a password as a command-line argument to avoid interactive password prompts during SSH logins. This is ideal for automating shell scripts on multiple or non-fixed servers where key-based authentication is not feasible.
  12. Implement dynamic micro-frontend routing using React-Router

    Meituan Waimai uses a 'Central Routing Base' architecture where the base system manages the loading and unloading of sub-projects. Instead of using heavy frameworks like Single-Spa, they leverage React-Router to minimize migration costs and bundle size.

    In React-Router v4+, routing is treated as a component. Dynamic loading is achieved by creating an asynchronous component that:

    1. Extracts a unique sub-project ID from the URL pathname.
    2. Fetches the sub-project's resource configuration (URL map).
    3. Loads the sub-project's JS entry file asynchronously.
    4. Renders the sub-project component once the resource is loaded and cached.
    export const AyncComponent: React.FC<{ hotReload?: number; } & RouteComponentProps> = ({ location, hotReload }) => {
      const [ayncLoaded, setAyncLoaded] = useState(false);
      const [subAppMapInfoLoaded, setSubAppMapInfoLoaded] = useState(false);
      const [ayncComponent, setAyncComponent] = useState(null);
      const { pathname } = location;
    
      // Extract sub-project ID from path (e.g., '/subapp/xxx/index' -> 'xxx')
      const id = pathname.split('/')[2];
    
      useEffect(() => {
        if (!subAppMapInfoLoaded) {
          fetchSubappUrlPath(id).then((data) => {
            subAppMapInfo = data;
            setSubAppMapInfoLoaded(true);
          }).catch(() => {
            goBackToIndex();
          });
          return;
        }
    
        const subappModule = (subAppMapInfo as any)[id];
        if (subappModule) {
          if (subappRoutes[id]) {
            setAyncLoaded(true);
            setAyncComponent(subappRoutes[id]);
            return;
          }
    
          currentPrefix = id;
          setAyncLoaded(false);
          const jsUrl = subappModule.js;
          loadAsyncSubapp(jsUrl)
            .then(() => {
              setAyncComponent(subappRoutes[id]);
              setAyncLoaded(true);
            })
            .catch(() => {
              setAyncLoaded(false);
              console.log('loading failed...');
            });
        } else {
          goBackToIndex();
        }
      }, [id, subAppMapInfoLoaded, hotReload]);
    
      return ayncLoaded ? ayncComponent : null;
    };