上一页 1 ··· 69 70 71 72 73 74 75 76 77 ··· 494 下一页
摘要: String collect: automaticlly calling concat on string let foo: String = vec!["this", "is", "a", "test"] .into_iter() .collect(); println!("{:?}", foo) 阅读全文
posted @ 2023-05-15 15:01 Zhentiw 阅读(84) 评论(0) 推荐(0)
摘要: docker exec container-id sh -c "patch -p1 < your-file.diff" Replace container-id with the ID of the container you want to run the command in, and your 阅读全文
posted @ 2023-05-10 22:53 Zhentiw 阅读(26) 评论(0) 推荐(0)
摘要: Few intertesting things from Rust Option<T>: with Some, unwrap() function todo(): to skil compiler error for a while unreachable(): similar to Typescr 阅读全文
posted @ 2023-05-09 01:03 Zhentiw 阅读(56) 评论(0) 推荐(0)
摘要: 1. TSD: https://github.com/SamVerschueren/tsd import {expectType} from 'tsd'; import concat from '.'; expectType<string>(concat('foo', 'bar')); expect 阅读全文
posted @ 2023-05-07 16:08 Zhentiw 阅读(38) 评论(0) 推荐(0)
摘要: Blog: https://www.totaltypescript.com/react-component-props-type-helper Get any Prop type from html element: import { ComponentProps } from "react"; t 阅读全文
posted @ 2023-05-07 16:04 Zhentiw 阅读(90) 评论(0) 推荐(0)
摘要: import {Expect, Equal} from "../types/utils" import { expect, it } from 'vitest'; type PayloadsToDiscriminatedUnion<T extends Record<string, any>> = { 阅读全文
posted @ 2023-05-07 16:00 Zhentiw 阅读(29) 评论(0) 推荐(0)
摘要: interface EnemyAttacker { fireWeapon(): void; driveForward(): void; assignDriver(driverName: string): void; } // Target class EnemyTank implements Ene 阅读全文
posted @ 2023-05-05 01:59 Zhentiw 阅读(24) 评论(0) 推荐(0)
摘要: With a long-running node server and a database, sometimes it's useful to ssh into the virtual machine to explore the file system, and look at the data 阅读全文
posted @ 2023-05-04 14:09 Zhentiw 阅读(35) 评论(0) 推荐(0)
摘要: Blog: https://dev.to/marclipovsky/discovering-the-power-of-javascript-proxy-after-all-this-time-4627 Lazy loading: const lazyLoadHandler = { get: func 阅读全文
posted @ 2023-05-04 13:45 Zhentiw 阅读(27) 评论(0) 推荐(0)
摘要: Example code: interface Fruit { name: string; price: number; } export const wrapFruit = <TFruits extends Fruit[]>(fruits: TFruits) => { const getFruit 阅读全文
posted @ 2023-05-03 01:55 Zhentiw 阅读(58) 评论(0) 推荐(0)
上一页 1 ··· 69 70 71 72 73 74 75 76 77 ··· 494 下一页