上一页 1 ··· 60 61 62 63 64 65 66 67 68 ··· 499 下一页
摘要: interface UnionBuilder<T = never> { add: <NewValue>() => UnionBuilder<T | NewValue>, fold: () => T } declare const u: UnionBuilder; const result = u . 阅读全文
posted @ 2023-12-27 22:21 Zhentiw 阅读(39) 评论(0) 推荐(0)
摘要: type NestedNumber = number | NestedNumber[] 阅读全文
posted @ 2023-12-19 21:33 Zhentiw 阅读(26) 评论(0) 推荐(0)
摘要: https://github.com/sharkdp/hyperfine hyperfine --runs 5 "CMD_1" "CMD_2" So it will run 5 times and compare CMD_1 vs CMD_2with a nice result summary 阅读全文
posted @ 2023-12-13 02:47 Zhentiw 阅读(28) 评论(0) 推荐(0)
摘要: #!/bin/bash # url will be a param been passed in url=$1 curl -X POST http://localhost:3000/endpoint -d "{\"payload\":\"$url\"}" -H "content-type: appl 阅读全文
posted @ 2023-12-13 02:27 Zhentiw 阅读(26) 评论(0) 推荐(0)
摘要: const returnWhatIPassIn = <const T extends any[]>(t: T) => { return t; }; // result is any[] in TS 5.2, but ['a', 'b', 'c'] in 5.3 const result = retu 阅读全文
posted @ 2023-12-13 01:55 Zhentiw 阅读(30) 评论(0) 推荐(0)
摘要: Ampt lets developers rapidly build, deploy, and scale JavaScript/TypeScript apps in the cloud without complicated configs or managing infrastructure. 阅读全文
posted @ 2023-11-24 02:04 Zhentiw 阅读(36) 评论(0) 推荐(0)
摘要: Refer to post: http://shebang.mintern.net/foolproof-html-escaping-in-javascript/ Code: var ESC_MAP = { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '& 阅读全文
posted @ 2023-11-23 15:41 Zhentiw 阅读(38) 评论(0) 推荐(0)
摘要: package data // new type type distance float64 type distanceKm float64 // add ToKm method to distance type func (miles distance) ToKm() distanceKm { / 阅读全文
posted @ 2023-11-21 15:49 Zhentiw 阅读(37) 评论(0) 推荐(0)
摘要: const generateTimeMs = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min /** * A generator which can generate numbers based on settings 阅读全文
posted @ 2023-11-18 17:25 Zhentiw 阅读(35) 评论(0) 推荐(0)
摘要: In Go, function can return multi value: func addAndSubstract(a int, b int) (int, int) { return a+b, a-b } It is also possible to define named return v 阅读全文
posted @ 2023-11-16 15:28 Zhentiw 阅读(34) 评论(0) 推荐(0)
上一页 1 ··· 60 61 62 63 64 65 66 67 68 ··· 499 下一页