PJCHENder's Technical Notes

website·Indexed 32 days ago

https://pjchender.dev/

A collection of technical notes and guides covering Data Structures and Algorithms (DSA) in JavaScript, TypeScript development (generics, interfaces, type manipulation), Chrome Extension development (Manifest V3, message passing, content scripts), and web service integrations including Vonage Video API and Facebook SDK.

Tokens
619.8K
Snippets
3.5K
Records
4.4K
Agent score
67%

What's inside PJCHENder

  1. Overview of the connect HOC in react-redux

    The connect function is a Higher-Order Component (HOC) used to filter or pre-process states and actions from the Redux store before they are passed as props to a React component. While it remains available and is primarily used for Class Components, useSelector and useDispatch hooks are the recommended approach for functional components since react-redux v7.1 (2019).
    connect([mapStateToProps], [mapDispatchToProps], [mergeProps], [options]);
  2. Overview of spf13/viper for Golang configuration management

    Viper is a configuration solution for Go applications. It provides capabilities to:

    • Read multiple configuration file formats including JSON, TOML, YAML, HCL, envfile, and Java properties files.
    • Define default values for settings.
    • Automatically reload and watch configuration files for changes.
    • Override configuration settings using CLI flags.
    • Read configuration from buffers or remote configuration systems.
  3. Overview of the Cache API

    The Cache API allows developers to store Request-Response pairs in the browser. It consists of two primary components: the caches global object (available on window), which is used to manage (create/delete) Cache Storage objects, and the cache object, which represents a specific storage containing individual request-response mappings.
  4. Overview of semantic-release automation

    semantic-release automates the entire package publishing workflow. It determines the next version number, generates release notes, and publishes the package based on commit messages. By default, it follows the Angular Commit Message Conventions to decide the version change (Semantic Versioning). Tools like commitizen or commitlint can be used to ensure developers write valid commit messages.
  5. Overview of Gin Web Framework features

    Gin is a high-performance HTTP web framework for Go. Its key features include:

    • Middleware Support: HTTP requests are processed through a chain of middleware (e.g., Logger, Authentication, GZIP).
    • Crash-free (Panic Recovery): Gin can intercept panics during HTTP request processing to prevent the server from crashing.
    • JSON Validation: Built-in capabilities to parse and validate incoming JSON data.
    • Route Grouping: Allows for organized routing structures.
    • Error Management: Integrated tools for handling errors.
    • Template Rendering: Built-in support for rendering HTML views.
  6. Overview of Ruby version management tools

    RVM (Ruby Version Manager) is used to manage multiple Ruby versions and their associated Gemsets (which manage gems for a specific Ruby environment). While RVM is functional, the community currently recommends using rbenv or asdf for macOS and Linux development environments due to simpler installation and better integration with modern tools.
  7. Overview of Software Defined Networking (SDN) and OpenFlow

    Software Defined Networking (SDN) is a networking approach that decouples the network into two distinct planes: the 'data plane' (responsible for data forwarding) and the 'control plane' (responsible for managing how data is forwarded). This allows users to customize network functions according to their specific requirements. OpenFlow is the standard specification used to implement these SDN concepts.
  8. Overview of RTK Query core concepts

    RTK Query (RTKQ) simplifies data fetching by eliminating the need for manual thunks or reducers to manage server state. Key features include automatic request deduplication (preventing multiple identical requests for the same resource on one page) and centralized API definition. Unlike SWR or React Query, RTK Query encourages defining all endpoints for a specific base URL within a single API slice to better track requests and cache invalidation.
  9. Overview of React Testing Libraries and Tools

    React testing typically involves a combination of the following tools:

    • jsdom: A simulated browser environment for Node.js, allowing DOM manipulation without a real browser.
    • Jest: A JavaScript test runner providing the framework for executing tests and assertions (e.g., expect, describe, test).
    • @testing-library/dom: The core library providing queries (e.g., getBy, findBy) to locate DOM nodes and event triggers.
    • @testing-library/react: Extends the DOM library to allow rendering React components into the DOM (render, screen, unmount).
    • @testing-library/jest-dom: Extends Jest with custom matchers specifically for the DOM (e.g., toBeInTheDocument()).
    • @testing-library/user-event: A library for simulating user interactions more realistically than fireEvent.
  10. Overview of Frontend Testing Types

    Frontend testing is generally categorized into three main types based on the scope of the test. The core concept across all types is comparing the 'expected result' against the 'actual result'.

    1. Unit Testing: Tests the smallest units of code (functions, methods, classes) in isolation. It verifies that a specific input produces the expected output.
    2. Integration Testing: Tests how multiple units or modules work together. This often involves API calls, library interactions, or DOM integration (e.g., verifying a React component renders data fetched from an API).
    3. End-to-End (E2E) Testing: Simulates real user behavior in a browser environment, testing the entire flow from entering a URL to completing a task.
  11. Overview of Passwordless and Multi-Factor Authentication (MFA)

    Alternative authentication methods to traditional passwords include:

    Passwordless Authentication:

    • OTP (One Time Password)
    • SSO (Single Sign-On)
    • OAuth 2.0 and OIDC (OpenID Connect)
    • Biometric Authentication

    Multi-Factor Authentication (MFA):

    • Time-based OTP
    • FIDO-based passwordless authentication (WebAuthn, CTAP)
  12. Overview of the TCP/IP Layered Model

    The TCP/IP model consists of four layers that handle network communication from hardware interface to application services. Data flows from the Application layer down to the Link layer at the sender (adding headers), and from the Link layer up to the Application layer at the receiver (removing headers).