上一页 1 ··· 65 66 67 68 69 70 71 72 73 ··· 491 下一页
摘要: For example you have two containers running Container A: need to talk to Container B Container B, running a node application export port 1337 From con 阅读全文
posted @ 2023-05-31 20:00 Zhentiw 阅读(13) 评论(0) 推荐(0)
摘要: Three rules: There can only be one value owner There can be unlimited immutable borrows (reference) with no mutable references There can be only one m 阅读全文
posted @ 2023-05-29 14:42 Zhentiw 阅读(54) 评论(0) 推荐(0)
摘要: Difference between yieldand return returnset doneto true /** * Example 1 */ function* loggerator() { console.log("running"); yield "paused"; console.l 阅读全文
posted @ 2023-05-25 17:39 Zhentiw 阅读(9) 评论(0) 推荐(0)
摘要: On mobile device, when you open / close the keyboard, zoom in / out, it might affect the visual viewport view (the actual page content); to detect cha 阅读全文
posted @ 2023-05-24 17:53 Zhentiw 阅读(20) 评论(0) 推荐(0)
摘要: React set the ref to null in runtime. It is a limitation now for react. import { useRef } from 'react'; export const Component = () => { const ref = u 阅读全文
posted @ 2023-05-24 15:11 Zhentiw 阅读(20) 评论(0) 推荐(0)
摘要: `Option` and `Result` are two very central enums in Rust, and they are used for error handling and for representing the absence of a value. Here is a 阅读全文
posted @ 2023-05-24 13:57 Zhentiw 阅读(88) 评论(0) 推荐(0)
摘要: Typescript: import fs from "fs"; const fileName = process.argv[2]; if (fileName) { fs.readFileSync(fileName) .toString() .split("\n") .map((num) => pa 阅读全文
posted @ 2023-05-24 13:52 Zhentiw 阅读(20) 评论(0) 推荐(0)
摘要: Typescript: function practice(nums: number[], index: number): number { return (nums[index] ?? index) * 5 } In Rust: fn practice(nums: Vec<usize>, inde 阅读全文
posted @ 2023-05-24 01:24 Zhentiw 阅读(14) 评论(0) 推荐(0)
摘要: background.ts: // TODO: background script chrome.runtime.onInstalled.addListener(() => { console.log("onInstalled..."); }); chrome.webRequest.onBefore 阅读全文
posted @ 2023-05-22 14:39 Zhentiw 阅读(130) 评论(0) 推荐(0)
摘要: // Imagine NavBar is an external library! export const NavBar = (props: { title: string; links: string[]; children: React.ReactNode; }) => { return <d 阅读全文
posted @ 2023-05-22 14:11 Zhentiw 阅读(15) 评论(0) 推荐(0)
上一页 1 ··· 65 66 67 68 69 70 71 72 73 ··· 491 下一页