Yang Lixin's Programming Notes

website·Indexed 31 days ago

https://yanglixin.com

A collection of technical notes and tutorials covering Go, Rust, Redis, and Next.js. Includes content on LeetCode algorithms, Solana development, gRPC, Docker, MongoDB replica set deployment, and software design patterns.

Tokens
131.2K
Snippets
453
Records
759
Agent score
50%

What's inside Yang Lixin

  1. Overview of Stablecoin Types and Mechanisms

    Stablecoins are cryptocurrencies pegged to real-world assets (e.g., USD, EUR, Gold) to maintain price stability. They are categorized by asset type and implementation mechanism:

    By Asset Type:

    • Fiat-pegged: Pegged to national currencies (e.g., USDT, USDC, DAI for USD; EUROC, EURT for EUR).
    • Commodity-pegged: Pegged to assets like gold (e.g., EKON).

    By Implementation Mechanism:

    1. Centralized Stablecoins: Issued by a central entity and backed by traditional assets (cash, bonds, real estate). Examples include USDT and USDC. Risks include credit risk of the issuer and regulatory freezes.
    2. Decentralized Stablecoins: Backed by digital assets (e.g., BTC, ETH) via smart contracts. Often use over-collateralization (e.g., depositing $20k of ETH to mint $10k of stablecoins) to ensure safety and transparency. Examples include DAI and pUSD.
    3. Algorithmic Stablecoins: Use algorithms to regulate supply and price without collateral. These are high-risk and prone to failure in extreme market conditions (e.g., the UST/LUNA collapse).
  2. Overview of Betxin Information Trading Market

    Betxin is an information trading market platform that allows users to trade predictions on controversial topics such as viruses, politics, cryptocurrency, and current events. Users build investment portfolios based on their predictions; if the prediction is correct, they receive a return. Users can buy predictions based on their outlook or sell them if the prediction does not meet expectations.
  3. Overview of Prometheus Architecture and Data Model

    Prometheus is a cloud-native monitoring system and time-series database (TSDB) designed for long-term trend analysis, alerting, and data visualization. It primarily uses a Pull model to collect metrics but can also receive data via a Pushgateway.

    Data is stored as time series, where each series consists of a metric name and a set of labels (key-value pairs) that describe the sample. For example: http_request_status{code='200', content_path='/api/path', environment='produment'}. Prometheus uses PromQL for querying and aggregating these metrics.

  4. Introduction to Turborepo (Turbo)

    Turborepo (Turbo) is a modern monorepo build system developed by Vercel. It is an engineering efficiency tool designed to manage multiple frontend and backend projects within a single code repository. It is particularly useful for enterprise-level product lines (e.g., admin panels, official websites, H5, mini-programs), teams sharing components across platforms (e.g., React Web and React Native), and full-stack personal projects.
  5. Overview of LocalSend for cross-platform local file sharing

    LocalSend is an open-source, cross-platform tool used to transfer files, folders, and text within a local area network (LAN). It does not require an internet connection; devices only need to be connected to the same Wi-Fi or hotspot to securely share data. It serves as a privacy-focused alternative to messaging apps (like WeChat) by avoiding local backups and cloud storage overhead.
    # Official Website: https://localsend.org
    # Source Code: https://github.com/localsend/localsend
  6. Overview of Docker's underlying technologies

    Docker achieves virtualization and isolation on Linux through four core technologies:

    1. Namespaces: Provides isolation of system resources (PID, UID, Network, IPC, etc.).
    2. Control Groups (cgroups): Limits and manages resource usage (CPU, Memory, Disk I/O).
    3. Union File Systems (UnionFS): Allows multiple file systems to be layered into a single virtual file system.
    4. Container Format: Defines the standard for container images and runtime.
  7. Overview of MarginFi Lending Protocol

    MarginFi is an open-source decentralized liquidity lending protocol on the Solana blockchain. Unlike AAVE, it uses a unified collateral pool where all deposited assets act as collateral for loans, provided the account's overall health factor remains safe. It utilizes a single variable interest rate model and does not offer fixed rates. A key architectural feature is that a single Solana address can initialize multiple lending accounts by paying the required rent.
  8. Overview of the samber/lo Go library

    The github.com/samber/lo library is a Go utility library inspired by Lodash (a popular JavaScript utility library), designed for Go 1.18 and later. It leverages Go generics to provide a type-safe alternative to older libraries like go-funk, which relied on reflection and were prone to runtime panics.
  9. Introduction to Finite State Machines (FSM)

    A Finite State Machine (FSM) is a model used to manage the behavior of a system by defining a finite set of states and the transitions between them based on specific inputs. It is particularly useful for flow and behavior control, ensuring that only valid operations are performed in a given state and that the system transitions to the correct subsequent state.

    An FSM consists of five core elements:

    1. Q: A finite set of states.
    2. Σ: A finite, non-empty set of valid inputs.
    3. q0: The initial starting state.
    4. F: A set of final or specially marked states (can be empty).
    5. δ: Transition functions that define the target state based on the current state and input (often represented as a transition table).
  10. Overview of Betxin: Polymarket Integration for Mixin

    Betxin is a tool that allows users to purchase Polymarket market orders directly from the Mixin ecosystem. The project was developed using a 'Vibe Coding' approach, where the developer wrote virtually no code manually, relying entirely on AI generation (Claude, Codex, and v0.dev) for requirements research, logic generation, and UI design.