Skip to content

Instantly share code, notes, and snippets.

@ThaddeusJiang
ThaddeusJiang / mac-folder-icon.md
Last active July 27, 2018 04:30
mac change folder icon (修改文件夹图标)

macOS change folder icon

  1. 下载 icon 推荐网站 Icon Archive 推荐像素 512px-1024px

  2. 使用“预览”打开 实际就是空格键。

  3. Command + c 复制

Docker

Docker 是容器技术。 是搭建基础设施不可缺少的技术,必须会。

主要概念

  • 镜像(Image)
  • 容器(Container)
  • 仓库(Docker Hub)
@ThaddeusJiang
ThaddeusJiang / docker.md
Created July 27, 2018 02:49
docker 使用手册

Docker 使用手册

  • 安装 Docker
  • 管理 Image
    • 下载 Image
    • 删除 Image
    • 制作 Image
  • 管理 Container
    • 启动 Container
  • 终止 Container
@ThaddeusJiang
ThaddeusJiang / jest-codecov-config.md
Last active July 27, 2018 07:06
These options in your package.json Jest configuration are not currently supported by Create React App

facebook/create-react-app#2474 (comment)

You should be able to pass it as a command line option. Since it doesn't seem to make sense for non-CI runs, you might as well do it like this:

  "test": "react-scripts test",
  "test:ci": "react-scripts test --testResultsProcessor ./node_modules/jest-junit",

and then set your CI server to run npm run test:ci.

Hope this helps!

@ThaddeusJiang
ThaddeusJiang / TODO.md
Created July 27, 2018 01:17
Module my-serializer-module in the snapshotSerializers option was not found.

带解决

@ThaddeusJiang
ThaddeusJiang / jest-global-variable.md
Created July 27, 2018 00:31
jest global variable
// package.json
"jest": {
  "globals": {
    "chrome": {
      "extension": {}
    }
  }
}
@ThaddeusJiang
ThaddeusJiang / chrome-new-window.md
Created July 27, 2018 00:29
chrome window.open new window not tab

必须指定 height、width。

  window.open(
    'https://gist.github.com',
    'gist',
    `width=${width}, height=${height}, left=${left}, top=${top}`,
  )
@ThaddeusJiang
ThaddeusJiang / js-Object-defineProperty.js
Created July 27, 2018 00:25
JS Object.defineProperty() 定义新属性,或者修改现有属性,并返回这个对象。
var o = {};
// o 必须已经存在
Object.defineProperty(o, "a", {
value : 37,
writable : true,
enumerable : true,
configurable : true
});
// Object.defineProperties() 可以一次性定义多个属性
@ThaddeusJiang
ThaddeusJiang / jest-test-chrome-extension.md
Created July 27, 2018 00:10
jest test chrome extension (mock chrome 对象)

因为 jest 运行环境没有 chrome 对象,我使用全剧对象。

  // package.json
  "jest": {
    "globals": {
      "chrome": {
        "extension": {}
      }
    }
 }