Skip to content

Instantly share code, notes, and snippets.

View xgqfrms's full-sized avatar
💭
🎉 👻 💻 🕵️‍♂️

xgqfrms xgqfrms

💭
🎉 👻 💻 🕵️‍♂️
View GitHub Profile
@xgqfrms
xgqfrms / 青红丝.md
Last active October 8, 2023 13:15
青红丝

青红丝

青红丝,也称红绿丝,或红丝、绿丝/青丝,是一种中国传统甜点原料,主要作用是配色美观。

青红丝来自橙皮、番木瓜、其他各种瓜或瓜皮等质地较硬的植物原料。 洗净切割成丁、丝、等形状后,用红或绿的食用色素染色,再用腌制,烘干而成。

青红丝色泽鲜艳,口感甜,有一定韧性;可以少量用于中式糕点、伍仁月饼、八宝饭等。

@xgqfrms
xgqfrms / minimal-reproducible-example.md
Last active October 20, 2023 06:47
How to create a Minimal, Reproducible Example - Help Center - Stack Overflow
@xgqfrms
xgqfrms / Aloha 👋.md
Created October 7, 2023 04:28
Aloha 👋

Aloha 👋

image

@xgqfrms
xgqfrms / Samba NAS Service.md
Created September 15, 2023 17:52
Samba NAS Service
@xgqfrms
xgqfrms / 开源在线在线学习平台.md
Created September 10, 2023 12:38
开源在线在线学习平台
@xgqfrms
xgqfrms / how-to-use-Promise-and-setTimeout-to-mock-an-api-call-in-javascript.md
Created September 8, 2023 05:00
How to use Promise and setTimeout to mock an API call in JavaScript

How to use Promise and setTimeout to mock an API call in JavaScript

如何使用 Promise 和 setTimeout 在 JavaScript 中模拟 API 调用

args list version

const getMockData = async (data = '', error = 'unknown server error', delay) => {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
@xgqfrms
xgqfrms / js Map.groupBy bug.md
Last active September 2, 2023 13:44
js Map.groupBy bug ❌

js Map.groupBy bug ❌

image

// polyfill all actual features - stable ES, web standards and stage 3 ES proposals:
// import "core-js/actual/index.js";
// ❌
// import "core-js/actual";
@xgqfrms
xgqfrms / ES6 Arrow Function returns an Object.md
Created July 5, 2023 16:43
ES6 Arrow Function returns an Object

ES6 Arrow Function returns an Object

the right ways

  1. normal function return an object
const getUser = user => {
 // do something
@xgqfrms
xgqfrms / fix: The domain name cannot be resolved temporarily.md
Created July 1, 2023 02:18
fix: `暂时不能解析域名“mirrors.tuna.tsinghua.edu.cn”` bug

fix: 暂时不能解析域名“mirrors.tuna.tsinghua.edu.cn” bug

$ sudo vim /etc/resolv.conf
# 添加如下内容
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 127.0.0.1
# 输入 Esc,:wq,保存并退出
@xgqfrms
xgqfrms / Node.js fs API promises.d.ts.md
Created June 19, 2023 15:04
Node.js fs API `promises.d.ts`

Node.js fs API promises.d.ts

/Users/xgqfrms-mm/Library/Caches/typescript/5.2/node_modules/@types/node/fs/promises.d.ts

/**
 * The `fs/promises` API provides asynchronous file system methods that return
 * promises.