03 2023 档案

摘要:Write a function that takes in two strings and returns their longest common subsequence. A subsequence of a string is a set of characters that aren't 阅读全文
posted @ 2023-03-30 01:35 Zhentiw 阅读(25) 评论(0) 推荐(0) 编辑
摘要:ProductCard component import './ProductCard.css'; import { ReactNode } from 'react'; import * as React from 'react'; import ProductCardContext from '. 阅读全文
posted @ 2023-03-30 00:58 Zhentiw 阅读(15) 评论(0) 推荐(0) 编辑
摘要:.card { width: min(700px, 90%, 70vw); // take the one currently is the min height: max(300px, 90%, 40vh); // take the one currently is the max font-si 阅读全文
posted @ 2023-03-30 00:42 Zhentiw 阅读(12) 评论(0) 推荐(0) 编辑
摘要:Refer to https://dev.to/frehner/css-vh-dvh-lvh-svh-and-vw-units-27k4 he lvh, svh, and dvh units in CSS are used to specify heights relative to the vie 阅读全文
posted @ 2023-03-30 00:37 Zhentiw 阅读(32) 评论(0) 推荐(0) 编辑
摘要:const demoFunc = <TObj extends {}>(obj: TObj, key: ErrorIfNever<keyof TObj, `You much pass at least one key`>) => { return obj[key as keyof TObj] } ty 阅读全文
posted @ 2023-03-30 00:29 Zhentiw 阅读(14) 评论(0) 推荐(0) 编辑
摘要:// Initialize a 2D array with zeros const str1 = "Hello" const str2 = "World" const dp = Array.from({ length: str1.length }, () => Array.from({ length 阅读全文
posted @ 2023-03-28 14:30 Zhentiw 阅读(13) 评论(0) 推荐(0) 编辑
摘要:Problem: Levenshtein Distance Write a function that takes in two strings and returns the minimum number of edit operations that need to be performed o 阅读全文
posted @ 2023-03-28 14:27 Zhentiw 阅读(14) 评论(0) 推荐(0) 编辑
摘要:You're given a non-empty array of arrays where each subarray holds three integers and represents a disk. These integers denote each disk's width, dept 阅读全文
posted @ 2023-03-26 20:06 Zhentiw 阅读(23) 评论(0) 推荐(0) 编辑
摘要:In React, every update is split in two phases: During render, React calls your components to figure out what should be on the screen. During commit, R 阅读全文
posted @ 2023-03-20 22:03 Zhentiw 阅读(54) 评论(0) 推荐(0) 编辑
摘要:When you want a component to “remember” some information, but you don’t want that information to trigger new renders, you can use a ref. import { useR 阅读全文
posted @ 2023-03-19 03:07 Zhentiw 阅读(24) 评论(0) 推荐(0) 编辑
摘要:import { WatermarkOverlay } from '../watermark-overlay' describe('WatermarkOverlay', () => { let cmp: HTMLElement let fixture: HTMLElement let shadow: 阅读全文
posted @ 2023-03-18 02:56 Zhentiw 阅读(11) 评论(0) 推荐(0) 编辑
摘要:<style> @media print { .no-print { display: none !important; } } </style> <div class="overlay--container no-print" >...</div> 阅读全文
posted @ 2023-03-16 22:23 Zhentiw 阅读(7) 评论(0) 推荐(0) 编辑
摘要:const rtf = new Intl.RelativeTimeFormat( navigator.language ) const res = rtf.format(-2, 'day') console.log(res) // "2 days ago" 阅读全文
posted @ 2023-03-16 15:31 Zhentiw 阅读(10) 评论(0) 推荐(0) 编辑
摘要:const calendarEvent = { title: 'abc submit', date: new Date(123), attendees: ["Steve", {name: 'Steve'}] } const copied = structuredClone(calendarEvent 阅读全文
posted @ 2023-03-16 15:18 Zhentiw 阅读(29) 评论(0) 推荐(0) 编辑
摘要:type TMethodListener<T> = (copyFn: T, ...args: any[]) => void; type TBuildInfo<TOverriden> = { mutationList: TOverriden; error?: string; }; /** * @des 阅读全文
posted @ 2023-03-11 22:50 Zhentiw 阅读(17) 评论(0) 推荐(0) 编辑
摘要:Say we have code below in the application: const generateRandomColor = () => { let result = ''; for (let index = 0; index < 6; index++) { const [eleme 阅读全文
posted @ 2023-03-06 15:30 Zhentiw 阅读(20) 评论(0) 推荐(0) 编辑
摘要:import express, { RequestHandler } from 'express'; import { it } from 'vitest'; import { z, ZodError } from 'zod'; import { Equal, Expect } from '../h 阅读全文
posted @ 2023-03-02 16:42 Zhentiw 阅读(58) 评论(0) 推荐(0) 编辑
摘要:import { expect, it } from 'vitest'; import { Equal, Expect } from '../helpers/type-utils'; export function compose<T1, T2>(func: (t1: T1) => T2): (t1 阅读全文
posted @ 2023-03-02 03:23 Zhentiw 阅读(19) 评论(0) 推荐(0) 编辑
摘要:const pick = <TObj, TKeys extends (keyof TObj)[]>(obj: TObj, picked: TKeys) => { return picked.reduce((acc, key) => { acc[key] = obj[key]; return acc; 阅读全文
posted @ 2023-03-01 22:30 Zhentiw 阅读(32) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示