摘要: Creational patterns provide object creation mechanisms that increase flexibility and reuse of existing code. Factory method: Provides an interface for 阅读全文
posted @ 2024-01-23 15:11 Zhentiw 阅读(67) 评论(0) 推荐(0)
摘要: Just for fun... Given a number (always positive) as a type. Your type should return the number decreased by one. For example: type Zero = MinusOne<1> 阅读全文
posted @ 2022-10-07 22:57 Zhentiw 阅读(101) 评论(0) 推荐(0)
摘要: Blog: https://www.geeksforgeeks.org/es6-trampoline-function/ Stackoverflow problem for recursion: const sumBelow = (number, sum = 0) => ( number 0 ? s 阅读全文
posted @ 2022-08-18 14:32 Zhentiw 阅读(85) 评论(0) 推荐(0)
摘要: Serverless framework with AWS Link to each sections Table of Content: Part 0: Serverless Project structure Part 1: DynamoDB & ApiGateway Part 2: Event 阅读全文
posted @ 2021-05-17 15:15 Zhentiw 阅读(192) 评论(0) 推荐(0)
摘要: Storage Services: S3 Glacier CloudFront Elastic Block Store (EBS) Storage Gateway Snow family Database Overview Block storage: Used on local networks 阅读全文
posted @ 2021-03-15 03:06 Zhentiw 阅读(196) 评论(0) 推荐(0)
摘要: S3 Features Prefiees and delimiters For example: the file name in S3 can be: `marking/plans/kpi_2021_1.pdf`. The point is make it looks like a folder 阅读全文
posted @ 2021-03-12 17:34 Zhentiw 阅读(192) 评论(0) 推荐(0)
摘要: In our previous code, we have seen this partten for operators: // #region operators const concat = curry((broadcaster, listener) => { let string = ''; 阅读全文
posted @ 2020-10-25 21:54 Zhentiw 阅读(191) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2020-05-07 18:22 Zhentiw 阅读(0) 评论(0) 推荐(0)
摘要: Generators can yield promises which can work with the "for await of" loop syntax. This lesson shows how all the pieces fit together and explains why t 阅读全文
posted @ 2020-03-22 02:59 Zhentiw 阅读(197) 评论(0) 推荐(0)
摘要: In this post, we are going to see how to use Ramda Lens. For example, we have data: R.lens: R.lens takes a getter and a setter: R.lensProp: There is a 阅读全文
posted @ 2019-02-24 20:12 Zhentiw 阅读(749) 评论(0) 推荐(0)
摘要: Just like the State ADT an Array is also an Applicative Functor. That means we can do the same tricks with liftA2 with Array that we have been doing w 阅读全文
posted @ 2019-01-16 16:30 Zhentiw 阅读(765) 评论(0) 推荐(0)
摘要: Use custom Cypress command for reusable assertions We’re duplicating quite a few commands between the registration and login of our user for assertion 阅读全文
posted @ 2018-12-06 21:13 Zhentiw 阅读(457) 评论(0) 推荐(0)
摘要: Use Cypress to test user registration Let’s write a test to fill out our registration form. Because we’ll be running this against a live backend, we n 阅读全文
posted @ 2018-12-05 15:54 Zhentiw 阅读(390) 评论(0) 推荐(0)
摘要: Despite the fact that Cypress is an application that runs natively on your machine, you can install it and add it as a dependency just like all other 阅读全文
posted @ 2018-12-05 02:38 Zhentiw 阅读(607) 评论(0) 推荐(0)
摘要: Ensure Functions are Called Correctly with JavaScript Mocks Often when writing JavaScript tests and mocking dependencies, you’ll want to verify that t 阅读全文
posted @ 2018-11-06 04:25 Zhentiw 阅读(455) 评论(0) 推荐(0)
摘要: 1. Color Picker (Chrome) You might know how to use color picker in Chrome, recently there is a feature inside color picker which is "Contrast Ratio", 阅读全文
posted @ 2018-07-15 18:41 Zhentiw 阅读(276) 评论(0) 推荐(0)
摘要: We'll examine how to unnest function calls, capture assignment, and create a linear data flow with a type we call Box. This is our introduction to wor 阅读全文
posted @ 2016-12-11 21:47 Zhentiw 阅读(371) 评论(0) 推荐(0)
摘要: Well, this stuff will be a little bit strange if you deal with it first time. Container Object: Just a wrapper / contianer for values No Method No Nou 阅读全文
posted @ 2016-09-06 04:23 Zhentiw 阅读(383) 评论(0) 推荐(0)
摘要: First, what is 'High Order function', basic just a function, inside the function return another fuction. For example: Decorators is a subset of high o 阅读全文
posted @ 2016-06-14 03:10 Zhentiw 阅读(423) 评论(0) 推荐(0)
摘要: Somehow it looks like reflect in Java. For example: We define an mothod on the Object, it called defineMethod(). It accepts two arguements, one is met 阅读全文
posted @ 2016-05-02 03:06 Zhentiw 阅读(455) 评论(0) 推荐(0)
摘要: 渡一原创 作者:谢杰 在很多前端工程的 package.json 中,你会看到这样一行配置: { "packageManager": "pnpm@11.9.0" } 而项目的 README 通常会告诉新成员: corepack enable pnpm install 如果你之前没有接触过 Corep 阅读全文
posted @ 2026-10-07 14:38 Zhentiw 阅读(15) 评论(0) 推荐(0)
摘要: Git 默认不会跟踪空目录,执行 git status 时可能看不到它们。 假如你现在的目录都为空 frontend-engineering-system/ ├── apps/ ├── packages/ ├── docs/ └── README.md 可以先验证一下: git status 如果 阅读全文
posted @ 2026-09-28 15:07 Zhentiw 阅读(10) 评论(0) 推荐(0)
摘要: Executive Summary This document outlines a five-phase migration from a monolithic Express API (all logic in one file) to a clean layered architecture 阅读全文
posted @ 2026-07-14 18:10 Zhentiw 阅读(16) 评论(0) 推荐(0)
摘要: Purpose This skill helps Claude create distinctive, memorable frontends that avoid generic AI-generated design patterns. It emphasizes typography, col 阅读全文
posted @ 2026-06-30 19:48 Zhentiw 阅读(32) 评论(0) 推荐(0)
摘要: What are hooks? And why hooks matter PreToolUse: PostToolUse: Safety: Prevent destructive commands (rm -rf, git push --force, credential exposure). Qu 阅读全文
posted @ 2026-06-30 19:43 Zhentiw 阅读(61) 评论(0) 推荐(0)
摘要: Content Query Rewrite Query Expand Multi-query Query Decomposition HyDE Query Rewrite Query Rewrite is a rewirting strategy. It means: without changin 阅读全文
posted @ 2026-06-01 13:35 Zhentiw 阅读(22) 评论(0) 推荐(0)
摘要: In the indexing stage of RAG, the core idea is to transform raw documents into searchable index data that can be consumed later. I usually break it do 阅读全文
posted @ 2026-05-21 14:00 Zhentiw 阅读(24) 评论(0) 推荐(0)
摘要: For a RAG system, indexing is not just about putting chunks into a vector database. It usually includes three major parts: 1. Chunk Splitting This ste 阅读全文
posted @ 2026-05-19 13:48 Zhentiw 阅读(22) 评论(0) 推荐(0)
摘要: /** * 带重试的 LLM 调用执行器 * * 默认行为:重试时自动将错误信息反馈给 LLM,让它能够根据错误修正输出 * * @param model 可调用的模型(需要有 invoke 方法) * @param messages 初始消息数组 * @param options 重试配置 * @ 阅读全文
posted @ 2026-05-03 16:08 Zhentiw 阅读(22) 评论(0) 推荐(0)
摘要: /** * 通用提示词片段 * 用于在各个节点的 System Prompt 中复用 */ /** * JSON 安全输出提示词 * 强调 LLM 必须生成严格合法的 JSON */ export const JSON_SAFETY_PROMPT = ` 【JSON 输出安全规则 - 必须严格遵守】 阅读全文
posted @ 2026-05-03 16:03 Zhentiw 阅读(83) 评论(0) 推荐(0)