A Bite of Cookie
最近在看 Ben Awad 在 Youtube 上的 Typescirpt + GraphQL Fullstack 教程,其中用户认证是通过 Cookie 实现的。视频中开发时 http://localhost:4000/graphql 跳转的是 ApolloServerPlayground,而我学

最近在看 Ben Awad 在 Youtube 上的 Typescirpt + GraphQL Fullstack 教程,其中用户认证是通过 Cookie 实现的。视频中开发时 http://localhost:4000/graphql 跳转的是 ApolloServerPlayground,而我学
git 清除缓存 在更新 .gitignore 之后已经提交的文件仍然会被 git 跟踪,这时候需要清除缓存: git rm -r --cached . && git add . git commit --amend --no-edit 计算颜色是亮还是暗 经验计算: /** * 计算颜色亮度, 返
这是一篇书签性质的文章 购买 VPS 和域名 VPS 使用的是 Digital Ocean $5 一个月的配置: 8 GB Memory / 4 Intel vCPUs / 160 GB Disk / NYC1 - Ubuntu 20.04 (LTS) x64 初始化的时候可以选择是否只允许 ssh
import CodePen from "../../components/solid/CodePen"; 遇到一个问题,子元素为绝对定位,父元素宽度固定,试图调整子元素的 right 使其能在父元素外展示。开始以为是 z-index 的问题,但是没有成功。 这是失败的样子: <CodePen sl
开启 wsl 与安装 Ubuntu 详见 官方文档 ,最好是 windows pro 专业版,linux 发行版直接从应用商店安装即可 shell 配置 在应用商店下载 Windows Terminal 界面现代化。顺便安利一波 PowerToys,微软开源的 windows 效率工具合集软件。 安
名词 以下都是预检查,类似于 (?:) 非捕获型分组,匹配到的内容不会被捕获 (?=pattern) _Positive Lookahead Assert_ 正向肯定预检查 (?<=pattern) _Positive Lookbehind Assert_ 反向肯定预检查 (?!pattern) _
这本书很老了,代码基本都过时了,整理出来看看也罢。 // 模拟 new 的行为 Function.prototype.method = function (name, func) { this.prototype[name] = func; return this; }; Function.meth
在 Promsie 中抛出异常 之前有一次想通过在 promise 中抛出异常,通过 try catch 捕获到异常,然后实现某种逻辑。当时搜了一下,有人说用 setTimeout ,那个时候我对 event loop 、 microtask & macrotask 还没有什么概念。现在我也记不得当
字体 字体一般只要是等宽就行了。推荐一款很好用的等宽字体 FiraCode ,可以开启 Font Legatures(连字符),只需在设置里面打开就行: "editor.fontLigatures": true, 快捷键 ctrl + shift + p ,输入 shortcut,可以看到 快捷键参
img load 事件 最近有一个需求,需要用到 canvas drawImage。看了一下 MDN 上的 canvas 教程,刚开始写出来是这样的: var img = new Image(); img.src = `${prefix}avatar.png`; img.onload = funct