01 2023 档案

摘要:### Create a docker file 1. Cd to the project: `cd widget-factory-inc/` 2. create a dockerfile: `vim dockerfile` ```bash FROM httpd:2.4 RUN apt update 阅读全文
posted @ 2023-01-31 19:57 Zhentiw 阅读(104) 评论(0) 推荐(0) 编辑
摘要:Union type: function runGenerator(generator: { run: () => string } | (() => string)) { if (typeof generator 'function') { return generator(); } return 阅读全文
posted @ 2023-01-31 19:36 Zhentiw 阅读(23) 评论(0) 推荐(0) 编辑
摘要:TypeScript 5.0 now allows JSDoc to declare overloads with a new @overload tag. Each JSDoc comment with an @overload tag is treated as a distinct overl 阅读全文
posted @ 2023-01-30 15:50 Zhentiw 阅读(139) 评论(0) 推荐(0) 编辑
摘要:https://devblogs.microsoft.com/typescript/announcing-typescript-5-0-beta/#exhaustive-switch-case-completions In the example code: type HasNames = { na 阅读全文
posted @ 2023-01-30 15:47 Zhentiw 阅读(50) 评论(0) 推荐(0) 编辑
摘要:Configuration and Installation Obtain the Azure login credentials: az login Copy the code provided by the command. Open a browser and navigate to http 阅读全文
posted @ 2023-01-29 20:28 Zhentiw 阅读(50) 评论(0) 推荐(0) 编辑
摘要:The following code import { expect, it } from 'vitest'; import { Equal, Expect } from '../helpers/type-utils'; export interface Cache<T> { get: (key: 阅读全文
posted @ 2023-01-29 20:14 Zhentiw 阅读(15) 评论(0) 推荐(0) 编辑
摘要:Storing Container Data in AWS S3 Introduction Using Docker volumes is the preferred method of storing container data locally. Volume support is built 阅读全文
posted @ 2023-01-28 17:37 Zhentiw 阅读(192) 评论(0) 推荐(0) 编辑
摘要:import { expect, it } from "vitest"; import { Equal, Expect } from "../helpers/type-utils"; function youSayGoodbyeISayHello(greeting: unknown) { retur 阅读全文
posted @ 2023-01-27 19:49 Zhentiw 阅读(17) 评论(0) 推荐(0) 编辑
摘要:Introduction Docker volumes is the preferred method of storing container data locally. Volume support is built directly into Docker, making it an easy 阅读全文
posted @ 2023-01-27 04:35 Zhentiw 阅读(140) 评论(0) 推荐(0) 编辑
摘要:Storing data within a container image is one option for automating a container with data, but it requires a copy of the data to be in each container y 阅读全文
posted @ 2023-01-27 02:43 Zhentiw 阅读(41) 评论(0) 推荐(0) 编辑
摘要:Pull httpd image and run the container [cloud_user@ip-10-0-1-78 ~]$ docker pull httpd:2.4 [cloud_user@ip-10-0-1-78 ~]$ docker run --name webtemplate - 阅读全文
posted @ 2023-01-25 15:06 Zhentiw 阅读(12) 评论(0) 推荐(0) 编辑
摘要:Sometimes we when switch branch, might bring some modified files into the new branch to cleanup those files git clean -df https://git-scm.com/docs/git 阅读全文
posted @ 2023-01-25 04:36 Zhentiw 阅读(19) 评论(0) 推荐(0) 编辑
摘要:Pull httpd:latest image Normally you want to attach the version httpd:2.4, because everytime you run the image, we with the same version is running. b 阅读全文
posted @ 2023-01-25 04:25 Zhentiw 阅读(12) 评论(0) 推荐(0) 编辑
摘要:let context = [] function cleanup(observer) { for (const dep of observer.dependencies) { dep.delete(observer) } } function subscribe(observer, subscri 阅读全文
posted @ 2023-01-24 04:21 Zhentiw 阅读(28) 评论(0) 推荐(0) 编辑
摘要:Previously, we have problem for such code: type RGB = readonly [red: number, green: number, blue: number]; type Color = { value: RGB | string }; const 阅读全文
posted @ 2023-01-19 04:45 Zhentiw 阅读(33) 评论(0) 推荐(0) 编辑
摘要:import { test } from '@playwright/test'; test.beforeEach(async ({ page }) => { await page.goto('http://localhost:3000'); }); test('selectors', async ( 阅读全文
posted @ 2023-01-18 16:14 Zhentiw 阅读(36) 评论(0) 推荐(0) 编辑
摘要:In this lesson, we are using HTML, accessibility concepts, and ARIA attributes to improve the time scrubber feature of an audio player. The goal is to 阅读全文
posted @ 2023-01-17 16:07 Zhentiw 阅读(10) 评论(0) 推荐(0) 编辑
摘要:Consider this createClassNamesFactory function that's similar to one I built for getting Tailwind class names that could then be passed into a React c 阅读全文
posted @ 2023-01-17 15:31 Zhentiw 阅读(15) 评论(0) 推荐(0) 编辑
摘要:This exercise begins with a makeStatus function that takes in an array of TStatuses that extends an array of strings. The statuses are then returned, 阅读全文
posted @ 2023-01-16 15:39 Zhentiw 阅读(15) 评论(0) 推荐(0) 编辑
摘要:There are two solutions to this challenge, both with different ways of representing the generic. Solution 1: The first option is using TConfig which e 阅读全文
posted @ 2023-01-14 22:20 Zhentiw 阅读(16) 评论(0) 推荐(0) 编辑
摘要:See this code: const array = [ { name: 'John', }, { name: 'Steve', }, ]; const obj = array.reduce((accum, item) => { accum[item.name] = item; // Eleme 阅读全文
posted @ 2023-01-14 01:37 Zhentiw 阅读(22) 评论(0) 推荐(0) 编辑
摘要:Here we have a Component class that can be passed in TProps. Inside of the constructor it assigns props to this, and provides a getProps method that c 阅读全文
posted @ 2023-01-12 15:53 Zhentiw 阅读(19) 评论(0) 推荐(0) 编辑
摘要:Consider this implementation of returnBothOfWhatIPassIn: const returnBothOfWhatIPassIn = (params: { a: unknown; b: unknown }) => { return { first: par 阅读全文
posted @ 2023-01-11 15:25 Zhentiw 阅读(12) 评论(0) 推荐(0) 编辑
摘要:Let's we have a form to submit new password. Before we send request to server, we want to force developer to valid the password before sending the req 阅读全文
posted @ 2023-01-04 15:54 Zhentiw 阅读(19) 评论(0) 推荐(0) 编辑
摘要:// print type PrintStart = { type: "print"; subtype: "start"; attributes: { controlsId: string; tabId: number; }; } type PrintAbort = { type: "print"; 阅读全文
posted @ 2023-01-04 03:46 Zhentiw 阅读(12) 评论(0) 推荐(0) 编辑
摘要:Let's imagine you're building a type helper to extract out the value from several different 'parsers'. Here are a few different examples of what a par 阅读全文
posted @ 2023-01-02 15:38 Zhentiw 阅读(16) 评论(0) 推荐(0) 编辑
摘要:Binding to Media Events import './assets/css/style.css'; import autumnMp4 from './assets/media/autumn.mp4'; const app = document.getElementById('app') 阅读全文
posted @ 2023-01-02 01:59 Zhentiw 阅读(17) 评论(0) 推荐(0) 编辑
摘要:A company has hired N interns to each join one of N different teams. Each intern has ranked their preferences for which teams they wish to join, and e 阅读全文
posted @ 2023-01-02 01:39 Zhentiw 阅读(107) 评论(0) 推荐(0) 编辑

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