# Pre 2017
# Articles
- 给 DevOps 初学者的入门指南 (opens new window)
- HTTP: The Definitive HTTP (opens new window)
- http2-ietf (opens new window)
- google developers (opens new window)
- Algorithms, 4th Edition (opens new window)
# 2017/01/05
- vim
- lightline solarized
- shell
- $#
- arguments length
- $*
- arguments list
- $@
- arguments list
- difference between '' and ""
- '' 原样输出
- "" 解释变量
- $[3 * 4 + 9]
- 直接在shell中进行数学计算
- $#
- javascript
- use strict
- zsh-themes
- muse
- cloud
- wuffers
- peepcode
- simple
- lambda
- dieter
# 2017/01/10
- tmux
- -s / server, session
- tmux new -s shanyue
- -s / server, session
# 2017/01/13
- git
- count commit
- git shortlog --sumary --numbered
- git shortlog -sn
- count commit
# 2017/01/14
- ansible
- get started
# 2017/01/17
- docker
- Dockerfile arguments
- docker build | memory cpu build-arg
- ENV always overwride ARG
- HEALTHCHECK
- curl -L www.zhihu.com
- 追踪重定向后的地址
# 2017/01/18
- tcp
- iptables
- docker
- ansible
- ansible all --module-name ping --user dev
- ansible examples (opens new window)
# 2017/01/19
- ansible
- 幂等性
- ansible-playbook sites.yml
- ansible-playbook sites.yml --list-hosts
- ansible-playbook sites.yml --list-tags -i(--inventory-file)
- Action Shorthand
- linux
- sudo -H
- sudo --preserve-env
- 在 sudo 模式下,可以使用普通用户的配置,比如 ~ 下的一系列配置
- css
- modal
- 自身高度过于屏高,自身滚动条与外部滚动条
- flex
- difference with width and flex-basis
- what are the differences between flex basis and width (opens new window)
- 当flex-direction为column的时候,flex-basis 就是指height了
- difference with width and flex-basis
- modal
# 2010/01/22
- git
- git-hooks
- pre-commit
- 在提交之前可以进行一些lint的检查
- pre-commit
- git-hooks
- css (think)
- rem(root) & em
- .container(font-size: 20px) > .row(font-size: 2em) > .item(font-size: 2em, height: 2em)
- 求.item(height)是多少px
- .container(font-size: 20px) > .row(font-size: 2em) > .item(font-size: 2em, height: 2em)
- border and center
- flex(align-items: center) flex-item(align-self: stretch)
- rem(root) & em
# 2017/01/24
- git-hooks (review 2017/01/22)
- pre-commit
- patch
- reset
- revert
- working/stage/repositry
- ansible
- handlers
- file
- proctocal
- icmp (internet control message protocal)
- 一种为query message,一种为 error message,一般所使用的 ping 发的是 ECHO_REQUEST 包
- icmp (internet control message protocal)
- shell
- iptables
- react
- life cycle
- graphql
# 2017/01/25
- ansible
- 回滚
- root /etc/hosts
- docker
- portainer set user
- 只需要在 Dockerfile 中指定 User 即可,id -u 可以查看本机的user id
- portainer set user
- git
- submodule
- css
- background
- background-origin
- background-clip
- background-attachment
- background-blendmode
- background
# 2017/01/26
- ansible
- ProxyCommand
- ansible_user / ansible_port / ansible_host / ansible_connection
- network
- route
- nc
# 2017/01/27
- http
- pragma: no-cache
- from memory cache / from disk cache
- Command Line API
- copy
- monitor
- monitorEvents
# 2017/01/28
- 前端部署 (opens new window)
- CDN
- hash
- 非覆盖发布
- 超长缓存
# 2017/01/29
- css
- rgba(0,0,0,.3) => rgb(179,179,179)
- Alpha Compositing (opens new window)
- Stacking Context
- absolute, relative + z-index: n
- fixed
- flex-item + z-index: n
- transform
- opacity
- tmux
- pane-boder-width
- npm
- shrinkwrap
# 2017/01/30
- event
- pagehide / pageshow / visibilitychange / bfcache browser backward mechanism
- html
- window.opener
- target="_blank" 漏洞
- ES6
- class and proptype
# 2017/02/01
- containing block
- position
- sticky
- position
- writing mode
- horizontal-tb
- vertical-lr
- vertical-rl
- css
- text-transform
- text-orientation
- upright
- mixed
- github
- img
# 2017/02/02
- json web token
# 2017/02/03
- vim
- emmet
- CSS function
- attr
- a:empty::after{ content: attr(href) }
- CSS Values Level 3
- calc
- CSS Values Level 3
- inline-block + calc incorrect left-right layout
- attr
- baseline
- ::after
- Selectors Level 3
- inline-block space
- white-space-collapsing: discard (Text Level 4)
- FormData
- ansible
- yum
- YAML
- --- seperate directives from document content
# 2017/02/04
- ARP(Address Resolution Protocal)
- basic concept
- arp cache
- A (ip, MAC) B (ip) broadcast -> local newwork
- arp spoofing
- basic concept
- css3
- all: unset
- ansible
- file
- get_url
- yum
- apt
- template
- ansible
- file mode 0755 why 0
# 2017/02/06
- tcpdump
- tcpdump host :ip
- tcpdump 'tcp port 80'
- wireshark
- Progressive Web Apps
- Cache Storage
- Service Worker
- Web Worker
- App Cache 从html5.1中移除
- Manifest
- orientation
- theme_color
- Notification Api
- Push Api
- ansible
- ansible-pull
- Roles
- ansible-galaxy
# 2017/02/07
- nslookup
- dig
- ansible
- pretask
- posttask
- inventory_hostname
- local_action
- notify / handle
- grid
- grid-auto-columns
# 2017/02/09
- ansible
- ansible-galaxy
- cosway
- git
- accept-hostkey
- error
- git
- known_hosts
- RSA
- SHA256
- ECDSA
- markdown
- escape
# 2017/02/10
- git
- git clean -d -fx ""
- content-box
- css
.row>.column*3
- .row height: 100px, .column: 100% (100px)
- .row height: auto(100px), .column:first-child: 100px (撑高父级) .column: 100% (0px)
- think: height (多列登高)
- min-height not work but work with height
- webpack
- webpack-dev-server source
# 2017/02/11
# 2017/02/13
- css
- property
- initial / inherit / unset
- svg
- glyph
- missing-glyph
- property
- ansible
- tags / always
- verbose / -vvv more / -vvvv debug
- git
- links
- tips
- git config color.ui true
- git help -g
- git update-ref -d HEAD
- git diff index / working
- git diff HEAD index, working / last commit
- git diff cached index / last commit
- git checkout -
- git branch -vv
# 2017/02/14
- git
- Signed-off-by (opens new window)
- The branch 'XXX' is not fully merged. (opens new window)
- git log --graph --left-right --cherry-pick --oneline origin...develop
- --cherry-pick
- Difference between "git add -A" and "git add ." (opens new window)
- Git for beginners (opens new window)
- tips
- git help everyday
- git commit -vv --amend
- git log master...develop
- git ls-files -o
- git submodule foreach git pull
- git cherry -v master
- 登录那些事 (opens new window)
- redux
- location.state 原理
# 2017/02/15
- react-router
- location.state souce-code
- history.js
- v3 window.history.state & sessionStorage
- v4 window.history.state 还没出 release notes,尴尬...
- history.js
- location.state souce-code
- peerDependencies
- semver
- Tilde ~
- Caret ^
- Hyphen -
- X x
- API
- satisfies
- Master the JavaScript Interview: What is a Closure? (opens new window)
# 2017/02/16
- git
- .git/info/exclude
- dir
- info
- hooks
- refs
- logs
- objects
- tips
- git hash-object :file
- git cat-file -p :commit-ish
- git remote set-url origin :url
- git add -p
- git whatchanged --since "2 days ago"
- git stash save -u | git stash save --include-untracked
- git clean -x -d -n remove untrcked + ignore
- git clean -X -d -n remove only ignore
- commit-ish
- md5 128bit
- sha1 160bit -> echo hello, world | shasum
- sha256 256bit
- sha512
- gerrit
- pre git
- diff / patch
- CVS (Concurrent Versions System)
- svn (Subversion)
- git -> BitKeeper (2005)
# 2017/02/17
- git
- concept
- git cat-file -t <commit-ish> -> type
- git cat-file -p <commit-ish> -> content
- tree
- blob
- tag
- commit
- tips
- git show <commit-ish>
- git show <branch-name>:<file-name>
- git rebase -i | reword -> commit-ish 会发生改变 修改以前的commit
- git commit --no-verify
- git commit -n
- git bisect | git checkout HEAD~7
- git reset <file>
- git shortlog
- git cherry -vv
- git status -sb -> --short --branch
- git log --oneline
- git ls-files
- git ls-files -s
- git ls-tree HEAD
- git reflog show master
- objects
- HEAD
- master
- refs/heads/master
- concept
- shell
- gawk
- wc
- react
- react.cloneElement()
- vim
- q -> recording
# 2017/02/18
- multi-column-layout
- git
- git reset -> index
- git reset --hard -> 清空 working tree & index & repo
- git reset --soft -> 清空 repo
- git reset --mixed -> 清空 index & repo
- git checkout -> 清空 working-tree
- git diff
- --name-only
- 只显示更改的文件名称
- --name-status
- 显示更改文件的名称以及状态
- --name-only
- git ls-files
- how-to-use-git-bisect (opens new window)
- git checkout <commit>
- git diff-index
- FE Think
- 项目启动期定好 state 和 router ,定好 webpack, eslint。
- 项目启动期定好一些基本组件,如常见的组件 Tooltip, Modal, Alert
- 否则技术债很多,比如后加的 eslint 形同虚设,中期难以迁移 webpack,难以 hmr,proxy,最重要是缓存的一些问题,以及各种形式的消息提示框。
- FP
- compose
- Git Flow Think +
# 2017/02/21
- react
- state is evil
- git
- git checkout HEAD~10 -> detached HEAD refers to a valid commit
- npm
- types
# 2017/02/22
- css
- font
- selection background-color 不符
- line-height: 1.5em 根据什么为基准
# 2017/02/23
- 论表格中的tooltip与层叠上下文
- git
- git push stratety
- central workflow
- non-central workflow
- upstream / simple
- git push stratety
- css
- ::after 权重
# 2017/02/24
- git
- follow
- git log need display date -> git log --pretty=medium
- tips
- git log -p <file>
- git log --first-parent
- git log master...develop
- git tag --list
- git describe -> v1.1.0-5-<hash>
- git rm <file>
- git checkout <commit-ish> -- <file>
- .git/info/exclude : core.excludesfile
- git archive -o tips.zip HEAD
- git rev-list master
- git rev-parse refs/tags/v3.0.2
- git revert HEAD
- git clone --bare
- git commit --allow-empty
- git show-ref
- git gc
- git
- 密码学大事件!研究人员公布第一例SHA-1哈希碰撞实例 (opens new window)
# 2017/02/25
- git
- git checkout -b test master
- git log master..develop
- git log master...develop
# 2017/02/27
- git
- go
- defer
- html
- html entity encode
# 2017/02/28
- cache
- cache-control
- age
- gulp
- gulp-rev
- FP +
# 2017/03/01
靡不有初鲜克有终
- gulp
- gulp 4.0
- FP
- Category Theory 范畴论
- HOC
- Partical Function
- compose
- curry
- Point-Free Style
# 2017/03/02
- RPC
- message queue
- FP
- Predicate
- Contract
- ES6
- setTimeout 浏览器环境与node环境不一致
- 如果你想靠前端技术还房贷,你不能连这个都不会 (opens new window)
- Excuse me?这个前端面试在搞事! (opens new window)
- Event Loop && promise
- Cache Control
- github
- taobao
- zhihu
- gold
# 2017/03/03
- js
- 'use strict' this | 严格模式与node
- node environment: module this node this (opens new window)
- Object.seal
- Object.freeze
- FP
- curry
- Constant -> Referential Transparency
- Category +
# 2017/03/05
宠辱不惊,闲看庭前花开花落。去留无意,漫看天边云卷云舒。
- FP
- ES6 ...args 无法确定个数 arity 为0
- declarative programing 声明式编程
- imperative programing 命令式编程
- functor
- Container.of
- Container.prototype.of
# 2017/03/06
岁月本长,而忙者自促;天地本宽,而狭者自碍;风花雪月本闲,而扰攘者自冗。
- FP
- docker
- aufs
# 2017/03/07
- primitive
- FP
- lift
# 2017/03/08
- FP
- Hinder-Milner (opens new window)
- parametricity
- react
# 2017/03/09
- js
- tc39
- git
- rebase --onto target
- 话说这个功能就像 chery pick 一样
- rebase -s
- 据说指定 strategy 可以直接 pull amend后的
- grep && ag
- rebase --onto target
# 2017/03/10
因过竹院逢僧话,又得浮生半日闲。
- webpack 热替换图片
# 2017/03/13
揣而锐之,不可长保。
- https://github.com/gotwarlost/istanbul
- https://github.com/remy/nodemon
- mocha
- nodeunit
- webpack
- yargs 解析命令行,就像是 python 的 argparse
- CommonsChunkPlugin
- ChunkManifestWebpackPlugin
- npm
- npm link webpack // symbol link
- debug
- node-inspector
# 2017/03/14
三十功名尘与土,三千里路云和月。
- Array.from(new Map())
- node-inspector
- 不是控制台,而是使用页面模拟一个控制台,不好使,比如监视某个变量
- sock-js webpack里用到的,貌似原生库? sockjs-client
- 举个栗子 setState 不能放到 componentWillMount 里边,失败告终...
- react class 的 this bind
- network
- 多域名:cdn 缓存 与 cookie 带宽
- what-happend-when
- 长轮询在服务器 cache,websockets 双向通信的二进制协议,sse content-type: event-stream 的文本协议。
- request and response
- DNT 不要追踪用户信息
- Cache-Control 缓存控制
- Transfer-Encoding
- Etag 协商缓存 If-Modified-Since
- X-Frame-Options 不允许嵌入 iframe
- method
- GET
- PUT
- POST
- DELETE
- HEAD
- OPTIONS
- vim
- 重新加载 :Agbuffer :bufdo e
- webpack 2.x
- optimize
creat-react-app 优化后仅有46kb (报的并不是 实际大小,而是需要gzip后的大小),而vue-cli 优化后有 90+ kb
- devtool: cheat-module-eval-source-map
- 1.97 mb native
- 1.81 mb webpack -p 即 --optimize-minimize (UglifyJsPlugin) --define process.env.NODE_ENV
- uglifyjs 报错 (opens new window)
- 1.80 mb UglifyJsPlugin 与 DefinePlugin 写到配置文件,自定义配置
- 4.06 kb / 1.80 mb 把所有三方库都放到 commons 后
- 1.46kb / 141kb 设置 devtool: ''
- gzip
- plugins
- html-webpack-plugin
- webpack-manifest-plugin 就像 gulp 的 gulp-rev
- extract-text-webpack-plugin
- react-dev-utils/InterpolateHtmlPlugin
- compression-webpack-plugin
- webpack-bundle-analyzer
- friendly-errors-webpack-plugin
- optimize
- chalk
# 2017/03/15
- ag --ignore-dir 好像直接忽略 .ignorefile
- webpack
- [big flag]
- CommonsChunkPlugin
- Long Term Caching (opens new window)
- manifest 存在的必要性 增量缓存
- source-read
- [].concat({ a:3, b:4 }) Array.prototype.concat() 参数可以是对象,来自 webpack 源码 processOptions #175 (opens new window)
- webpack.config.js 中 stats 是什么鬼? stats (opens new window)
- Error.stackTraceLimit = 30 ; 栈深
- ProgressPlugin
- output.chunkFileName 与 output.filename 的区别,为什么有两个...
- output 配置中 hash 与 chunkHash 的区别
- hash 为 webpack 打印第一行的值
- chunkhash 为每个 chunk 的 hash
- think:
- 404 页面是否应该重定向链接? 404 是否应该自动跳转? (opens new window)
# 2017/03/16
- webpack
- CommonsChunkPlugin manifest : how to work? 工程化思考
- MultiChunks
- TreeShake
- node-debug
- 多开浏览器还是挺酷的
- linux
- ps -ef
- ppid parent pid
- stime start time
- time
- tty
- ps -ef
# 2017/03/17
- webpack
- Object.defineProperty(__webpack_require__, '__esModule', { value: true })
- jsonp 控制多 chunk
# 2017/03/18
- vim
- Ctrl+P 如何查看隐藏文件
- 使当前标签页变为分屏页
# 2017/03/20
- vim
- = 缩进对于 object 出现问题
# 2017/03/21
- CC By 4.0
- webpack
- plugin apply(compile)
- Compiler => Tapable => Object
- WebpackOptionsApply
# 2017/03/22
- git prune
- webpack
- const-in-for-loop (opens new window)
for (const i of l) {}
for (let i=0; i<10; i++) { let i }
- scss
- 全局变量
- js
- [object object]
# 2017/03/23
功夫,两个字,一横一竖,赢的站着,输的躺下。
- https
- www.baidu.com 为什么访问的是 https 而非 http
- HSTS (opens new window)
- SSL 攻击
- Strict-Transport-Security: max-age=31536000
- Chrome 查看地址 HSTS
- HSTS (opens new window)
- www.zhihu.com 为什么没有设置 STS,仍然跳到 https?
- www.baidu.com 为什么访问的是 https 而非 http
- Do Not Track [https://www.zhihu.com/question/20615448]
- 不跟踪用户信息,浏览器设置,将会设置一个 DNT: 1 的请求头
- javascript
- '' && 3
- Boolean('')
- vim
- emmet class in jsx 应该是 className,jsx 插件是否能解决?
# 2017/03/24
- react
- setState 连续多次,如何渲染
- webpack
- 控制css被引入的顺序 module DFS
# 2017/03/26
- vim
- 关于 tmux 下vim主题的问题
- 背景显示不全,切换 term: screen-256color 解决问题
- 关于 tmux 下vim主题的问题
# 2017/03/27
- css
- difference between unset, initial, inherit
- all: unset
- color color 貌似也被排除在外
- style style 自身也有样式,display 初始值为 inline,而浏览器默认设置为 none
- unicode-bidi 排除在外
- direction 排除在外
- javascript
- eventloop, macrotask and microtask
# 2017/03/28
- closure
- promise 如何实现异步 的 once
- javascript
- webpack
- EntryPoint
- EntryChunk
- code splitting css
- algorithm
- 多路归并
# 2017/03/30
- JS
- typeof x => x // function subtype
- difference between function and arrow function
- f.prototype / this / class
- arguments / caller
- Array.isArray(Array.prototype) // true
- 为什么不是 object !!!!!!
- Number.prototype // Number
- String.prototype // String
- difference between function and object
- function // callable object
# 2017/03/31
- JS
- String
- s1 = new String('hello'); s1[0] = 'A' // 'hello'
- s2 = 'hello'; s2[0] = 'A' // 'hello'
- String
- css
- div: default: block; initial: inline;
- 浏览器 UA 默认为 block,其实初始值是 inline !!!
- div: default: block; initial: inline;
# 2017/04/01
- JS
- String
- string 是 immutable,因此任何方法无法改变其本身
- Array.prototype.reverse.call(s) 无法使其逆置,因为修改了自身
- this 不能赋值
- Number
- IEEE 754 64-bit binary
- 0o363 // octal
- 0b111 // binary
- 0x127 // hexadecimal
- 0.1 + 0.2
- Number.EPSILON 2^-52
- Number.MAX_SAFE_INTEGER 2^53 - 1
- Number.isSafeInteger
- 如何判断一个数是整数
- String
# 2017/04/05
- css
- vertical-align: middle 给图片设置!
# 2017/04/06
- images
- png, jpg, gif - stackoverflow (opens new window)
- png, jpg, gif - zhihu (opens new window)
- 分类
- 有损 / 无损
- Index Color / Direct Color
- 点阵图 / 矢量图
- inline
- span
- label
- i
- a
- b
- img
- inline-block
- textarea
- input
- select
- block
- div
- h1
- p
# 2017/04/07
- countdown
- 倒计时 多次计时
- react
- defaultProps 给 location.state 赋予默认值
- css
- vertical-align (opens new window)
- font-family
- 华文细黑:STHeiti Light [STXihei]
- 华文黑体:STHeiti
- 华文楷体:STKaiti
- 华文宋体:STSong
- 华文仿宋:STFangsong
- 儷黑 Pro:LiHei Pro Medium
- 儷宋 Pro:LiSong Pro Light
- 標楷體:BiauKai
- 蘋果儷中黑:Apple LiGothic Medium
- 蘋果儷細宋:Apple LiSung Light
- Windows的一些:
- 新細明體:PMingLiU
- 細明體:MingLiU
- 標楷體:DFKai-SB
- 黑体:SimHei
- 宋体:SimSun
- 新宋体:NSimSun
- 仿宋:FangSong
- 楷体:KaiTi
- 仿宋_GB2312:FangSong_GB2312
- 楷体_GB2312:KaiTi_GB2312
- 微軟正黑體:Microsoft JhengHei
- 微软雅黑体:Microsoft YaHei
- 隶书:LiSu
- 幼圆:YouYuan
- 华文细黑:STXihei
- 华文中宋:STZhongsong
- 华文仿宋:STFangsong
- 方正舒体:FZShuTi
- 方正姚体:FZYaoti
- 华文彩云:STCaiyun
- 华文琥珀:STHupo
- 华文隶书:STLiti
- 华文行楷:STXingkai
- 华文新魏:STXinwei
# 2017/04/10
- Dr. cleaner
- autojump
- nunjucks
# 2017/04/11
- yarn.lock
- template engine
- nunjacks
- jinja2
- Number IEEE754
# 2017/04/12
- tree
- emmet
- $$$$@2015
- downloads
- content-disposition:attachment;
- browsersync
# 2017/04/14
- emmet
- git submodule
- untracked content
- http status code
- 422 Unprocessable Entity -> github star error
- git
- ssh git@github.com
- 更改以前commit的author
- git filter-branch
# 2017/04/18
- ps
- ps 取 hex 色
- browsersync
- 关于 react + webpack 中可以使用 node 的模块其中原理
# 2017/04/19
- curl -O :url
- 直接下载文件
- browser_sync
- Get: Content-Type: application/octet-stream
- Post: Content-Type: text/html
# 2017/04/20
- node
- 一个程序,输出 1:n,思考为什么会卡,如何不卡
- 使其后台前台切换
- less 使其 buffer,并不会再终端限制行数
# 2017/04/21
- css @supports
- 很大程度解决了关于 IE8 CSS 的兼容问题 !
- filter
# 2017/04/24
- vim
- copy # V + !pbcopy
- vim --version
- javascript you dont't know
- compilation
- Tokening / Lexing
- Parsing # AST
- Code Generation
- compiler
- LHS
- RHS
- Not LHS
- let
for (let i=0; i<10; i++) {}
let i; for (i=0; i<10; i++) { let j = i }
- function declaration and function expression
- functions first
- Principle of Least Privilege
- compilation
# 2017/04/25
- js you dont't know
- IIFE
(function(){ foo = 3 function foo () { console.log('hello, world.') } console.log(foo) })() console.log(foo)
# 2017/04/26
- git
- 列举某个 commit 以后的所有 log
- 统计 commit 总数
- git rev-list --count --all
- log 只显示增改信息
- git log --stat
- 统计 merge commit 间有多少文件改动
- git diff :commit1 :commit2
- 统计 merge commit 间有多少个commit
- cheery-pick merge commit
- open-terminal-here-in-mac-os (opens new window)
# 2017/04/27
- licecap
- sessionStorage
- 什么才叫 session
- js you dont know
this
'use strict'; var a = 10; console.log(this.a);
Reminder: regardless of how you get to a function invocation using the default binding rule, the strict mode status of the contents of the invoked function making the this reference -- not the function call-site -- determines the default binding value: either the global object if in non-strict mode or undefined if in strict mode.
# 2017/04/28
- web server (opens new window)
- SuperSimpleCI (opens new window)
- You-Dont-Know-JS
- DMT # Object.create(null)
- difference between Object.create(null) and {}
- Object.create(null) # {}
- {} # {proto: {}}
- Hard Binding
foo.bind({ a:3 }).bind({ a: 4})
- Soft Binding # Todo
- Lexical this
- js 中方法和函数可以相互转化的,那么python呢
- a.run = types.MethodType(run, a)
- a.run = functools.partial(run, a)
# 2017/04/30
- js
<script type="module"></script>
- http2
- Article
# 2017/05/02
- You-Dont-Know-JS
- data descriptor
- Object.preventExtensions()
- Object.seal()
- Object.freeze()
- accessor descriptor
- [[get]] get ()
- [[put]] set ()
- Symbol.iterator 如何遍历一个对象!
- 原型模式中 Object.create 与 new 有何异同
- Object.setPrototypeOf(Bar.prototype, Foo.prototype)
- Bar.prototype = Object.create(Foo.prototype)
- Bar.prototype = new Foo() // this 上附带属性,且有副作用
- data descriptor
# 2017/05/03
- You-Dont-Know-JS
- Object.create
- {} // 等价于以下
- Object.create(Object.prototype)
- _proto_
- getter / setter
- proxy && python builit method
- delegation design pattern
- ES6 class super not support for modern browser !!!!
- Object.create
- git
- git pull --rebase --autostash
- git config --global --bool pull.rebase true
- growingIO
# 2017/05/05
- webpack template
- nomal
- IIFE (modules)
- webpack_require(id=entryModuleId)
- installModules
- modules[moduleId].call()
- jsonp
- webpackJsonp
- webpack_require.e(chunkId).then(webpack_require.bind(null, moduleId)).then(module => ...)
- installedChunks
- nomal
- grid
- justify-content: center; align-content: center;
- justify-items: center; align-items: center;
- http
- MIME
- http client
- 组件
- Proxy
- Proxy Cache
- gateway
- tunnel Connect
- schemas
- http
- https
- mailto
- ftp
- rtspu
- file
- news
- telnet
# 2017/05/06
- http
- request message
<method> <request-URL> <version> <headers> <entity-body>
- response message
<version> <status> <reason-phrase> <headers> <entity-body>
- Get 与 Message Body
- https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.3
- https://groups.yahoo.com/neo/groups/rest-discuss/conversations/messages/9962
- nc 与 telnet
- methods
- GET
- HEAD
- PUT
- POST
- TRACE
- OPTIONS
- DELETE
- request message
# 2017/05/08
谋定而后动,知之而有得到。
- cache
- json cache ?
- connection close
- http
- 使用 nc 模拟https请求
- 无法做到,openssl代替
- openssl s_client -connect server:443
- 无法做到,openssl代替
- openssl s_client -connect juejin.im:443
CONNECTED(00000003) 33628:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:/BuildRoot/Library/Caches/com.apple.xbs/Sources/OpenSSL098/OpenSSL098-59.60.1/src/ssl/s23_lib.c:185:
- 使用 nc 模拟https请求
- ncal
- deepCopy
- 循环引用
- LazyMan
# 2017/05/09
- react
- PureComponent (opens new window)
class MyComponent extends PureComponent {...}
- shouldUpdate = !shallowEqual(prevProps, nextProps) || ! shallowEqual(inst.state, nextState);
- $r.updater
- PureComponent (opens new window)
- scss
- 循环引用问题
- webpack
- webpackMissingModule
- css
- :only-child # apply child
- https
- HSTS http -> https
只要设置了 HSTS,http 手动输入也会自动变成 https307 internel redirect 昙花一现,其实应该是 temporary redirect- 再次测试:第一次 http 会 301 到 https,并带有STS头,以后http进去会由STS转为307 internel redirect,或者直接不向http发送请求直接转为https
- HSTS http -> https
# 2017/05/10
- http
- TIME_WAIT delays and port exhaustion
- 从TCP三次握手说起--浅析TCP协议中的疑难杂症 (opens new window)
- HTTP/1.1 Persistent Conection 默认保持连接,只有当 Connection: Close 的时候才会关闭,没有这个头也不代表一直在连接中,客户端与服务端都可以关闭闲置的连接。
- Content-Length 必须一致才能够持久连接
- 会根据 Content-Length 来截取报文
# 2017/05/11
- http & tcp
- bimodal request-reply behavior of HTTP
- 滑动窗口机制
- slow start
- pipelined connection
- canvas
- http://stackoverflow.com/questions/19699366/html5-canvas-to-pdf
# 2017/05/16
- nginx
- root 发现 403
- alias && root
- (opens new window)
- http
- 用户信息相关的头
- From
- User-Agent
- Referer
- Authorization
- Client-IP
- X-Forwarded-For
- Cookie
- Authorization
- 用户信息相关的头
- jwt (opens new window)
# 2017/05/17
- (opens new window)
- http
- cookie2 当前的状态 (opens new window)
- cookie
- 域名
- 路径
- 版本
- 0
- 1 (RFC2965)
- Discard
- Max-Age
- port
- $
- Http
无法被js访问
- Same-Site
- 缓存
- Cache-Control: no-store
- Cache-Control: no-cache
- Cache-Control: no-cache="Set-Cookie"
- Cache-Control: max-age=3600, s-maxage=3600
- Cache-Control: must-revalidate, max-age=0
- Cache-Control: public
- 试探性过期算法: LM-Factor
- nc 发送post请求
- Host header 的重要性
- 主要是代理
- 一个服务器托管了多个网站
- 422 Unprocessable Entity github star
- challenge/response
- Basic Authorization
- Degist Authorization
- OAuth
# 2017/05/18
- TCP Delay Knowledagement (opens new window)
- Nagle Algorithm,把多个小包放在一起一块发
- Delay Knowledagement,把Ack随着包一块发
- google/bbr (opens new window)
- vim
- 关闭一个tab的所有窗口
- http
- 数字证书
- 设置/HTTPS-SSL/管理证书
- 凭什么只认权威机构发的 (opens new window)
- PKI
- 数字签名
- PAC
- WPAD (Web Proxy Autodiscovery Protocal)
- 压缩代理器 (opens new window)
- 比如 Chrome For Android
- 数字证书
# 2017/05/19
- zhihu
- http
- Max-Forwards
- Proxy authentication
- 访问控制代理器 407
- Best nginx configuration for nginx (opens new window)
- cache
- chrome: chrome://cache/
- proxy cache
- varnish
- squid (opens new window)
- apache/trafficserver (opens new window)
- 如何判断文档来自原始服务器还是代理缓存
- Age
- Date
- 缓存不应该调整 Date header,表示原始服务器的时间
- ETag
- 弱验证器 W/"hello, world"
- Age (opens new window)
- 已缓存副本的使用期
- LM-factor
- 知乎为什么没有设置 Cache-Control 和 Expires 依然可以 From memory cache
- http2 知乎已启用
# 2017/05/20
- HTTP Caching - goolgle developer (opens new window)
- Difference between no-cache and must-revalidate (opens new window)
- What's the difference between Cache-Control: max-age=0 and no-cache? (opens new window)
- RFC 2616 is Dead (opens new window)
- http
- 多个网站托管在一个服务器时
- 许多服务器只接受路径,而不接收完整路径
- protocals
- HTCP (Hyper Text Caching Protocal)
- ICP
- CARP
- dns redirect
- nslookup static.zhihu.com
- dig static.zhihu.com
- algorithm
- 负载均衡算法
- 邻接路由算法
# 2017/05/23
- https连接的前几秒发生了什么 (opens new window)
- The First Few Milliseconds of an HTTPS Connection (opens new window)
- How does HTTPS actually work? (opens new window)
- http
- audio 206 & cache
# 2017/05/24
- 如何学习数据结构 (opens new window)
- interviews (opens new window)
- vim
- Ag 查找,关于打开的方式需要熟悉
- fold 需要熟悉
# 2017/05/26
- vim
- vertical resize 60 # 设置分割窗口的大小
# 2017/05/27
13 Ways To Defeat Your Fears and Embrace the Life You Want. (opens new window)
data structure
- Binary Heap
- heapify()
- Trie
- Router
- Immutable
- Hash Table
- Open Addressing
- 就是当 bucket 被占时,偏移知道找到没被占的 bucket
- Linked List
- Seperate Chaining
- 就是每一个 bucket 都是一个链表
- Open Addressing
- Binary Heap
# 2017/05/28
# 2017/05/30
- What algorithms and data structures should any software engineer know? (opens new window)
- Binary Search Tree
- balanced BST
- Balanced Factor
- zig
- zag
- balanced BST
# 2017/05/31
- data structure
- Red Black Tree
- Associative Array | Map | Dictionary
- hash table
- Red Black Tree
# 2017/06/01
- react
- this.setState({count: this.state.count + 1})
- this.setState(prevState => ({ count: prevState.count + 1 }), () => console.log(this.state.count))
- 赌徒谬论
# 2017/06/04
- gpu-accelerated-compositing-in-chrome (opens new window)
- 浏览器渲染详细过程:重绘、重排和composite只是冰山一角 (opens new window)
- chrome-gpu
- How browser work - book (opens new window)
- web browser engine (opens new window)
- Edge
- Webkit / Blink
- Gecko
- 理解关键渲染路径 (opens new window)
# 2017/06/05
- high-performance-networking-in-google-chrome - book (opens new window)
- performance
- network
- colors
- purple: ssl
- green: ttfb (Time To First Byte)
- blue: download
- 会显示 highest, high, low 优先级
- colors
- network
# 2017/06/06
- PageSpeed Insights (opens new window)
- devtool
- Audits
- 也可以分析性能
- Web Page Performance
- Network Utilization
- evaluate-performance (opens new window)
- Recalculate Style -> Layout -> Layer Tree
- Lines
- Blue Line: DOMContent
- Green Line: Fist Paint
- Red Line: Load
- firstContentfulPaint
- GC
- Major GC
- Minor GC
- DOM GC
- Audits
- http
- transferEncoding: chunked
# 2017/06/07
- react
- list > item (window.onresize)
- 在item的 componentDidMount 中调用了 window.onresize 方法...
- list > item (window.onresize)
- data-structure
- B-Tree
- why: 不同存储级别在访问上的巨大差异
- 可以看成把平衡二叉搜索树进行多路合并
- (2, 4) Tree
- splay-tree
- Locality
- 逐层伸展
- 双层伸展
- zig-zag / zag-zig
- zig-zig / zag-zag
- 不仅能够把最近访问到的点移至根节点,而且还可以使树高缩减一半
- B-Tree
# 2017/06/09
- css selector specificity
- w3-css3-selectors-specificity (opens new window)
- a, b, c, d 并不是十进制的,或者说1000个class有没有一个id权重大
# 2017/06/19
杀人放火金腰带,修桥补路无尸骸
- css
- background-image
- linear-gradient(90deg, rgba(255,255,255,0), #fff, rgba(255,255,255,0));
- transition in flex-direction not work
- flex-direction transition 不起作用
- CSS_animated_properties (opens new window)
- background-image
# 2017/06/20
- array-like -> array
- Array.prototype.concat.apply([], nodes)
- a-b-c -> aBC
# 2017/06/21
# 2017/06/23
- canvas
- quick-sort
# 2017/06/26
- canvas
- rect
- path
- arcs
- Ring
- Circle
- lines
- closePath()
- beginPath()
- arcs
- react
- refs (opens new window) and querySelector
- MVC
- 登录工程:现代Web应用的典型身份验证需求 (opens new window)
- d3 (opens new window)
# 2017/06/27
- vim
- :! %:p
- git
- git submodule foreach git pull origin mastter
- git submodule update --remote
- git submodule update --init --recursive
- quick sort
- space O(1)
- time
- average O(nlogn)
- O(nlogn)
- O(n2)
- unstable
- 变种快排
- stable / unstable : G 会向前滚动
# 2017/06/28
- canvas
- ring 添加动画
- confluence
- jira
- docker
- portainer 中console 半分钟挂掉的原因
- css3
- border-image 渐变动画
# 2017/06/29
- lifting-state-up (opens new window)
- Audio
- 一段视频的分片 blob.slice
- 一个问题,一个页面存在十个图片,会请求几次资源
# 2017/06/30
- CI/CD
- jenkinsci - gitlab - setup (opens new window)
- gitlab services (opens new window)
- 结合 jira 与 gitlab,每个 sub task 会关联一个或多个commit,多个commit需要进行mr,通过后自动关闭或者完成sub task,同样subtask后有关于gitlab的comment
- react 项目的组织方式
- component 与 container
- removeConsolePlugin
- tag
- jira
- gitlab
# 2017/07/03
- 考核
- [OKR](Objectives and Key Results)
- 谷歌内部考核制度 OKR 是怎样的? (opens new window)
- 量化
- 透明
- 弹性
- 自下而上
- [KPI](Key Performace Indicator)
- 关键绩效指标
- 严格遵循 SMART
- 自上而下
- 有什么刷 KPI 把产品给刷毁了的惨痛案例 (opens new window)
- [OKR](Objectives and Key Results)
- How do i cancel an http fetch request (opens new window)
- Aborting a fetch: The Next Generation (opens new window)
- containg box
- 如果元素的位置是’relative’ 或者 ‘static’,元素的包含块设置为最近的块级祖先元素的Content edge。
- 如果元素设置了position: fixed,包含块由viewport创建
- 对那些使用绝对(absolute)作为定位(postition)的非根元素,包含块设为最近的定位(postition)不是静止(static)的祖先元素(任何类型)。
- 如果没有祖先元素,包含块是根元素盒子的内容边界确定。
- quic/35
- http
- specification
- implelation
- css
- @media print
# 2017/07/04
- 什么是代码耦合 (opens new window)
- FP
- labmda演算
- 马尔科夫算法
- 生命游戏
- 细胞自动机
- (蓝鲸游戏)
- 图灵机
- FRP
- print
- 有些东西不能打印
- @media print
- 有些框框不能分两页打 (opens new window)
- page-break-inside
- page-break-after
- page-break-before
- 有些东西不能打印
# 2017/07/05
- tmux/iterm2 ring
- xmonad
- 单点登录
- js
- dva (opens new window)
- const f = x => x; f
3
- event/emmit
- ast
- data-structure
- Red Black Tree
- 红帽子
- 红鞋子
- 黑深度
- 红节点只能由黑孩子
- lifting
- 最小生成树
- Prim
- Kruskal
- Red Black Tree
# 2017/07/06
- 我接触过的前端数据结构与算法 (opens new window)
- OptimizeCSSDelivery (opens new window)
- defer / async (opens new window)
- https://html.spec.whatwg.org/multipage/scripting.html#the-script-element
- defer 有序,正常下载,延迟执行
- async 乱序,异步下肢,执行依然会阻塞渲染
- DOMContentLoaded (opens new window)
- DOMContentLoaded 之前脚本也会解析,而js高级程序设计中有误
- google analysis document (opens new window)
- [google tag manager]
- 垂直网站
- 特定领域特定需求
- 术语
- pv (page view)
- uv (unique visitor)
- ip
- dau (daily active user)
- bounce rate
- exit rate
# 2017/07/08
- css
- flex-grow / width / max-width 冲突
# 2017/07/09
- svg
- g.transform
- defs
- desc
- cx
- cy
- use
- path.d
- M moveto
- L lineto
- H
- V
- A arc
- Z closepath
- C curveto
- git
- git merge 没有冲突,git rebase 有冲突
# 2017/07/10
- git
- 列出已经合并到develop或者master的分支
- git branch --merged develop
- 删除已经合并到develop的分支
- git branch --merged develop | grep -v '^*' | xargs -n 1 git branch -d
- 列出已经合并到develop或者master的分支
- gitlab
- Configuration of your jobs with .gitlab-ci.yml (opens new window)
- Configuration of runner (opens new window)
- CI
- 前端如何为每一个 commit 生成一个 url,便于 code review
- 是否可以通过pipeline后,自动分配两个人进行 code review
# 2017/07/11
- jira workflow (opens new window)
- 目前工作流过于简单,探索一些效率更好的工作流
- 如何实施 SCRUM (opens new window)
- git flow
- 解决bug的时候应该一个bug一个分支,还是一个功能的bug一个分支
- gitlab
- 如何在本地生成 merge request (貌似不行)
- Web Animation Api
- 解决js中平滑过渡
- React ComponentsRedirect
- 比如有一个父组件 Animal,会发送一个请求决定去渲染 Cat,Dog 还是 Pig,最终显示的结果如下 Animal > Cat,那么如何把Animal给去掉,直接显示 Cat
- React.cloneElement
# 2017/07/12
- comparing workflows
- educloud (opens new window)
- 静态文件直接强制缓存,设置cache-control 为 no-cache,依然强制缓存,原因不明
- navigator.sendBeacon
- 又一种与服务器通信的方法!
- 可以在页面卸载时异步发送数据,并且不会减缓页面的切换速度
# 2017/07/15
- CSP
- html5
- script.crossorigin 属性是做什么的,script不是天生支持跨域?
- values
- use-credentials
- annoymous
- html ref (opens new window)
- python
- byte
- str
# 2017/07/18
- ga
- 位置中,如何获得指定国家的城市分布图
- 地理位置 / 自定义 / 自定义报告
- 什么是着落页(loading page),有什么用
- ga 中有该网站每个页面的加载时间,并且与 pagespeed 结合,对每个页面有一个打分
- traffic origin
- direct 直接输入网址
- organic 搜索引擎
- referral 从其他网站跳过来
- 位置中,如何获得指定国家的城市分布图
- etl(数据仓库技术)
- 什么是用户画像 (opens new window)
- 统计用户的社会属性,行为习惯以及消费行为等以便更好地营销
# 2017/07/19
- 音频卡顿问题
- ga
- timing (hit type)
- performance timing API
- performance.timing.fetchStart // 浏览器准备发送请求的时间
- performance.timing.domContentLoadedEventEnd // DOMContentLoaded
- performance.timing.loadEventEnd // load
- performance timing API
- PerformanceLongTaskTiming (ga的一个官方示例中代码,具体用来干啥未知)
- Long Tasks API
- PerformanceObservel (ga官方示例代码,应该是用来检测性能的)
- 如何做screen view
- 如何评测 Engagement (参与度)
- Page Depth
- Session Duration
- ga 是如何判断一个用户是回访用户还是新用户的
- cookies 中的 clientId 字段进行判断
- 另一种方法是 fingerprint
- timing (hit type)
# 2017/07/20
- 如何在同域下的两个标签页中进行通信
- window 不可以
# 2017/07/22
- ga
- ga 是如何做实时统计的
- ga 是如何统计人口特征的
- svg
- viewBox 和 width/height 有什么区别
- width/height 是实际像素,而viewBox按比例填充,包含元素单位按viewBOx为准
- property
- stroke-dasharray
- % 指以谁的基准 (unit identifier)
- stroke-dashoffset
- stroke-dasharray
- 如何使用path画一个圆
<path d="M 30 5 A 25 25 0 0 0 30 55 A 25 25 0 0 0 30 5" />
- 如何画一个loading动画图
- 如何画一个特定角度的弧
- 好像只能计算得出
- viewBox 和 width/height 有什么区别
- zhihu
- 知乎是如何检测离线的 (应该有对应的事件)
# 2017/07/23
- canvas + image
- document.images
- ctx.getImageData
- 获取每个像素点的数据
# 2017/07/25
- svg
- polyline 与 polygon 有什么区别
- polygon 自闭合
- 如何使text居中
- how to place and center text in an svg (opens new window)
- text(x=50%, y=50%, alignment-baseline=middle, text-anchor=middle)
- 关于svg的盒模型
- svg如何插入图片
- image(x=0, y=0, width=50, height=50, xlink:href=url)
- 那在 react 中呢...
- polyline 与 polygon 有什么区别
# 2017/07/26
- jira
- 如何添加 filter
- store 的更新造成了 componentWillReceiveProps 都执行了一遍
- ant-design 关于样式的问题
- webpack 关于 data-url 的问题
# 2017/07/27
- svg 与 iconfont 比较,有什么优缺点
- svg 纯文本,增改方便
- iconfont 引用方便,只能使用单色
- svg sprite (opens new window)
- http 中 body 负载过大如何处理
- openshift 如何与 k8s 协同使用
- iptables
- solr
- 微服务的模式语言 (opens new window)
- getting started for sketch
- source map 的原理
# 2017/07/29
- dns
- dns 服务器分为哪几种类型
- dns root name servers 是什么,为什么只有13组
- 什么是任播 anycast
- dns 递归解析的过程是什么样子的
- dns 可以使用tcp不
- when do dns queries use tcp instead of udp (opens new window)
- 512 Byte
- DNSSEC
- udp 的报文格式是什么样子的
- opendns/8.8.8.8/114.114.114.114
- https
- PKI
# 2017/07/30
- IP (internet protocal)
- Package Delivery Model
- Connectionless
- Best effort delivery (unreliable)
- lost / out of order / duplicate / delay
- How Layer3 Routers Work
- stop and forward
- IP Address Lookup (Forwarding Table)
- RIP / OSPF / BGP
- Table { IP, Next }
- 但是如果不在 Table 中怎么办
- IP/MAC mapping table
- ASICs 加快查表 (hardware)
- Wire Speed Forwarding
- Not Plug-and-Play
- IP Datagram Header Format
- id / offset
- ttl 的作用什么
- 128,经过128跳就要被扔了
- 避免成环
- 如何判断两个host在一个network中
- Flag
- Dont Fragment 不能切片
- 如果不能分片,但是分包很大怎么办
- Header Cheaksum
- Type of Service (Tos)
- Precedence
- Delay
- Throughtoutput
- Fragment
- R
- Package Delivery Model
# 2017/07/31
- document.domain
- http
- 413
- dhcp
- pxe/netboot/cobbler
- ip
- trackroute 172.16.3.2
- ip route / route -n
- 如何知道自己的主机有几台网卡 ip link
- dns
- nsad
- forward / cache / bind
- dig (domain information groper)
- dig @server name type
- FQDN 是什么
- 域名和路径会不会区分大小写
- label 最大有多少个字符
- dig +trace @8.8.8.8 www.smartstudy.com
- dig @8.8.8.8 www.smartstudy.com
# 2017/08/01
- mongo
- db
- ip
- httpbin (opens new window) 与 ifconfig.me 上的 ip 和百度上查的ip不一样
- ga
- stats.g.doubleclick.net
- ga 是如何统计会话时间的
# 2017/08/04
- CI
- package.json script sh expansion + sh
- animate
- shell
- sed -i '' '' file MAC
- sed -i '' file Linux
- GPL 与 BSD 有什么不同
# 2017/08/07
- 127.0.0.1 与 localhost 的区别
- rsync
- rsync -av src/ dest
- rsync -av src dest
- rsync -av src/ static dest
# 2017/08/09
- ~ + .
- webpack
- DLLPLUGIN
# 2017/08/10
- 影响copy速度的原因有哪些
- user op is not allowed to execute
- visudo
- webpack
- chunkFileName
- http://engineering.invisionapp.com/post/optimizing-webpack/
- shell
- 循环 for do done
a=(1 2 3 4 5) for i in $a; do echo $i; done
- seq 1 10
- ` and ${}
- 循环 for do done
# 2017/08/12
- shell
- pstree
- ps -efL
- 查看线程
- who
- 查看多少人连接本机
- tty
- 伪终端
- ls /dev/tty*
- echo hello >> /dev/pts/38
- node
- bundlesize
- jest
# 2017/08/13
- shell
- mosh
- mosh 建立在 UDP 之上,可以不被 timeout 掉
- 如果登入 server 需要 identity file,可以配置 ~/.ssh/config:IdentityFile
- mosh
- webpack errors
- Uncaught TypeError: (0 , createClass3.default) is not a function
- code splitting 当按需加载的模块中有css改变时,触发重新编译,但是运行时的代码丢了,导致白屏
# 2017/08/14
- shell
- sysctl
- 查看和设置内核状态
- ls /proc/sys 也可以查看
- perf
- sysdig
- netstat -rn -> route -r
- sysctl
- network
- ICMP
- query + error message
- ping -> type ECHO_REQUEST
- ICMP
- os
- 关于文件系统的系统调用
# 2017/08/15
- devDependencies 和 dependencies 的库混乱对build有没有影响
- hmr
- You cannot change Router routes
- react-hot-loader 3 (opens new window)
- react-router match
# 2017/08/17
- git
- 大小写问题
- 大小写敏感
- mv test.js Test.js 没有任何反应
- 大小写不敏感
- ox x
- git mv index.js Index.js 增加Index.js,但在暂存区不删除index.js
- ox x
- 大小写敏感
- 大小写问题
- webpack
- webpack 比 webpack3 re-compile 的时间要多不少
- iconv-loader: the request of a dependency is an expression
- hot-update.json 是如何生成的
- source-map 的原理是什么
- shell
- 如何求一个文件的hash值 shasum
# 2017/08/18
- shell
- iconv
- control chrarcter
- os
- HFS+ mac的文件系统
- diskutil info /dev
- lsblk 列出块级设备
- mount 挂载文件系统
- df
- HFS+ mac的文件系统
- node
- npm run prestart
# 2017/08/20
- jira
- 如何查看以前的sprint
# 2017/08/22
- react ant
# 2017/08/23
- css
- .row > .col-4 * 12
- 为什么会挤走
- .row > .col-4 * 12
# 2017/08/24
- koa
- 返回object,Content-Type 直接为application/json,不像flask那样需要自己设置...
- 关于版本提示
- prestart: check-node-version
- node
- swig
- if (!module.parent) app.listen(3000);
- Math.random().toString(32).slice(2) 生成一个随机字符串
- git
- 如何查找更改的文件数
- git diff HEAD --stat
- 如何查找更改的文件数
# 2017/08/25
- redis
- redis-cli --scan | HEAD 10 查找redis中的前十项
- redis-cli --scan --patern re 查找匹配字符串
- get/set/hget/hset/lpush/rpush/lrange
# 2017/8/27
- SELinux
# 2017/8/28
- js/test
- coverage report
- statements
- branch
- if 分支的个数,偶数
- functions
- 函数的个数
- lines
- ava
- nyc
- coverage report
- w3 与 whatwg 的区别
- sql
- varchar && text 的区别
- https://stackoverflow.com/questions/2023481/mysql-large-varchar-vs-text
- varchar 存储实际内容,而text存储实际内容的指针
- varchar 可以有排序规则,text没有
- varchar && text 的区别
# 2017/8/31
- curl
- curl -G uri --data-urlencode 自动编码
- -G 代表 --get
- curl -G uri --data-urlencode 自动编码
- sequelize
- LIKE
- {$like: '%a%'}
- LIKE
# 2017/09/04
- test js
- 如何测试 promise
- 如何测试 callback
- 覆盖率测试的原理如何
# 2017/09/05
- gitlab
- 当有人回复mr的时候接受Notification
# 2017/09/06
- js
- try { const a = 1; const a = 2 } catch (e) {}
- 为什么没有捕捉到
- 因为编译失败
- 为什么没有捕捉到
- try { const a = 1; const a = 2 } catch (e) {}
# 2017/09/07
- sql
- ANSI sql
- query to count the number of tables in mysql
- show tables; select found_rows()
- how to find all databases in mysql
- show databases
- show schemas
- how to query the autoincrement
- show table status like :table \G
- how to get information for a specific table
- show table status like :table \G
- check what character encoding a table has
- show create table :table
- show table status like :table
- check what storage engine a table uses
- show create table :table
- select table_name, engine from information_schema.tables
- what is difference between with join and left join?
# 2017/09/08
- sql
- how to create/delete a database
- drop database :db
- what data types mysql support
- char (2^8)
- varchar (2^8)
- text (2^16)
- blob (2^16)
- tinyint (2^8)
- smallint (2^16)
- mediumint (2^24)
- int (2^32)
- datetime
- timestamp
- json (5.7.8)
- how to create/delete a database
- python
- implementation of True and 1
- The class bool is a subclass of the class int
- implementation of True and 1
# 2017/09/09 植物园
花开有落时,人生容易老。
# 2017/09/12
- system design
- load balancer
- how to keep Session persistence ?
- layer 4 load balancing
- layer 7 load balancing
- what is downstream server
- how to prevent single point of failure?
- load balancer
- what function HAproxy support?
- random
- round robin (with weight)
- cookie / session
- solid principle
- what is single responsibility principle?
- Open closed principle
- Liskov substitution principle
- Dependency inversion principle
- Interface surgregation principle
- Object Store Service
- 块存储,对象存储,文件存储的本质差别是什么 (opens new window)
- http://searchcloudstorage.techtarget.com/feature/How-an-object-store-differs-from-file-and-block-storage
- SQL Write Master-Slave / SQL Read Replicas
- Statement-Based Replication
- Row-Based Replication
- Binlog -> Replaylog
- what difference between varnish and cdn?
- https://varnish-cache.org/docs/index.html
- federation
- load balancer
# 2017/09/13
Everything is a trade-off
- db
- what is cache locality
- principle of locality 局部性原理,比如 splay-tree,cache
- ACID
- Atomicity
- Consistency
- 比如事务
- Isolation
- Durablity
- SQL tuning
- index
- B-tree
- index
- what is cache locality
- system design
- how to design a shortening service
# 2017/09/14
# 2017/09/15
- DOM
- encodeURI
- encodeURIComponent
- js
- Number.isNaN 与 isNaN 的区别
- parseFloat 与 Number 的区别
# 2017/09/16
- mysql 的连接数过小
- 如何查看连接数
- SHOW STATUS WHERE
variable_name
= 'Threads_connected' - SHOW VARIABLES;
- SHOW STATUS WHERE
- 如何配置最大连接数
- /etc/mysql/mysql.conf.d/mysqld.cnf -> mysql配置文件
- 如何禁掉解析client域名
- 如何查看连接数
- shell
- 设置成vi模式后,无法在编辑模式下删除
# 2017/09/18
- postman
- env
- sequelize
- attributes.include
- 可以添加一些计算的属性
- where object 与 sequelize.fn 共存
- 好像是不行的
- attributes.include
- sql
- 在创建表时如果没有指定null规则,则默认为default null -> mysql
- 如何指定默认时间为当前时间
createAt datetime not null default current_timestamp;
- auto initialized
createAt datetime not null default current_timestamp on update current_timestamp;
- auto update
- CURRENT_TIMESTAMP()
- NOW()
- LOCALTIME
- LOCALTIME()
- LOCALTIMESTAMP
- LOCALTIMESTAMP()
- 时区问题
show global variables like '%time_zone%';
- UTC / GMT
- CST
- js
- object 略掉 undefined 的数据
_.pickBy(o, x => x !== undefined)
- 解读
lodash.get
与lodash.result
的源码- 先解析路径为 Array
- 取最大的时间戳
- sql 如何取最大的时间戳
- object 略掉 undefined 的数据
# 2017/09/19
- mysql
- update students set
createTime
= 1505791922 where id = 14; (1292, u"Incorrect datetime value: '1505791922' for column 'createTime' at row 1") - datetime & timestamp diff and similar
- range
- datetime 1000 - 9999
- timestamp 1970 - 2038
- range
- timestamp 与 datetime 应该如何插入数据
- insert into t1 (ts) values ('2017-09-19 20:34')
- update students set
- js
- mobx 中的toJS
- 把 observable 类型转化为 object
- mobx 中的toJS
# 2017/09/20
- git
- 如何查看本分支下是否还有未提交的东西
- git cherry -v
- 清除所有 stash
- git stash clear
- 如何查看本分支下是否还有未提交的东西
- sql
- 检索某一列最大的字符长度
- select name, length(name) as len from students order by len desc limit 1;
- 检索某一列最大的字符长度
# 2017/09/21
- js
- Array.prototype.sort
- a > b 升序
- Array.prototype.sort
- 敏捷
- 关于gitlab+prd结合的两种方案
- ci + nginx
- page + nginx
- .gitlab/merge_request_templates
- gitlab-merge-request-approvals (opens new window)
- 关于gitlab+prd结合的两种方案
# 2017/09/22
- sql
- enum
- shirt enum('xs', 's', 'm', 'l', 'xl');
- enum
- 敏捷
- 写测试用例 -> 与测试对比 -> 不一致与产品讨论 -> 不可测技术讨论,预想实现 -> 估时(分清边界,熟悉与不熟悉) -> 实现
# 2017/09/25
- sql
- show triggers;
- stored routine
- 如何查看有多少 procedure 和 function
- show function status \G
- show procedure status \G
- 如何查看有多少 procedure 和 function
- show processlist;
- 显示多少进程在连接本数据库
# 2017/09/27
- sql
- 给数据库表添加注释
- alter table student comment '测试数据库表'
- 给数据库表添加注释
- antd 如何替换 iconfont 的cdn地址
- modifyVars 不起作用
- iconfont.cn
- font-face: font-family, src
# 2017/09/29
- os
- 取决于硬盘读取数据速度的因素是什么
- 寻道时间 / 旋转时间 / 读取时间
- two-phase lock 是如何解决死锁问题的
- RAID 是什么,RAID-0 到 RAID-5 有什么改进
- 取决于硬盘读取数据速度的因素是什么
- db
- two-phase lock 是什么
- ansi sql 的四种隔离级是什么,如何查看mysql默认的隔离级
- MVVC 如何解决幻读的问题
# 2017/09/30
- create-react-app
- react-dev-utils/prepareProxy
- dotenv
- jest
- toMatchSnapshot
- enzyme
- .mount 与 .render 的区别
# 2017/09/25 ~ 2017/10/01 (week 35)
- 存储过程的作用是什么,function 与 procedure 有什么区别
sql
是弱逻辑的,存储过程使 sql
更具逻辑性。
function(User Defined Function)
是自定义函数,必须返回一个值,用在检索数据上,不能更改数据。比如 max
,sum
,concat
这些,使用 select f(a)
调用。
procedure(Storaged Procedure)
是存储过程,执行一系列命令,使用 call p()
调用。
数据库的四种隔离级是什么,什么是可重复读,幻读
二段锁(2PL)如何解决数据库的死锁问题
MVVC 是什么,原理是什么
影响磁盘读取速度的因素有哪些
RAID 是什么,RAID 各个级别有什么不同
sass 与 less 是否可以配置替换文件中的变量,是否可以在配置文件中预设好变量
# 2017/10/02
- sql
- show table status 中的 Avg_row_length 是如何计算出来的,为什么与自己定义的列的存储长度不一致
- ip 地址和带毫秒的时间戳应该在数据库中怎么存储
# 2017/10/10
- sql
- 集成式测试工具
- ab
- JMeter
- Rtree
- Prefix Index
- Index Selectivity
- 使前缀的选择性接近全列的选择性
- 不能使用 order 和 group
- Index Selectivity
- explain
- rows 访问了多少行
- type 使用什么样的访问类型
- Full Table Scan
- Index Scan
- Range Scan
- Unique Index Lookup
- Constant
- 集成式测试工具
# 2017/10/14
- sql
- show index from :table
- cardinality
- explain
- select_type (opens new window)
- 使用json格式输出
- explain format=json select * from student
- select_type
- dependent subquery
- select 中的查询,依赖于外部查询
- primary
- derived
- simple
- dependent subquery
- rows
- filtered
- type
- const
- 当查询主键时
- ref
- 当查询索引时
- range
- 当查询索引并且是范围时
- index
- all
- 查询非索引时
- const
- 使用json格式输出
- select_type (opens new window)
- 非规范化
- 预先计算
- 缓存
- index
- alter table add key (exam_id)
- alter table add key (exam_id)
- show index from :table
# 2017/10/09 ~ 2017/10/15 (week 37)
- enzyme.mount, enzyme.render,enzyme.shallow 的区别是什么
- 什么是死锁,常见解决死锁的方案有哪些
- chai 做为一个断言库,提供了哪些 API
- expect().to.equal()
- expect().to.eql() -> expect().to.deep.equal()
- expect().to.be.null
- expect().to.be.undefined
- expect().to.be.empty
- expect({ a: 1 }).to.have.property('a', 1)
- expect().to.include()
- expect().to.satisfy(n => n > 1)
- 如何获取查询sql所耗费的时间
# 2017/10/16
- mysql
- global variables
- long_query_time // 慢查询
- slow_query_log
- slow_query_log_file
- log_queries_not_using_indexes // 不使用索引的查询
- if(condition, true_value, false_value)
- global variables
- fe
- css 会阻塞渲染吗
- js 为什么要放到最后边
- 资源文件的并发下载
- 有哪些时间点
- keyBy 函数
# 2017/10/17
- docker
- docker network ls
- app
- sequelize 中如何使用存储过程
# 2017/10/20
- 国学项目8080在nginx中被占
- 一个各种统计页面的前端store设计
- db.upsert
- on duplicate key update
- sequelize 生成的scheme不会把key带上
- 数据库测试
- koa
- 中间件只提供给个别接口
- 中间件的response.status是404
- 请求前后做处理,相当于hook
# 2017/10/21
- vim
- 选中内容双引号
- 当前行位置为最中间
- zz
- zb
- zt
- ctx.query
- (opens new window)
- (opens new window)
- 当 ctx.query.a = 3 时,进行了什么操作
# 2017/10/16 ~ 2017/10/22 (week 37)
- 在 container 中如何连接 host 的网络
- mysql
- timestamp format
# 2017/10/23
- Promice.race
- 如何判断一个对象是空
# 2017/10/26
- sql enum 返回数字
- sql
- 排序规则
- 时间排序
- 字符串排序
- 数字排序
# 2017/10/30 |||
- canvas
- shape
- rect
- fillRect(x, y, width, height)
- strokeRect(x, y, width, height)
- clearRect(x, y, width, height)
- path
- beginPath()
- closePath()
- fill()
- stroke()
- arc(x, y, radius, startAngle, endAngle, antiClockWise)
- rect
- shape
- bezier curver
# 2017/10/31 ||
- koa
- delegates
- ab测试
# 2017/11/01 ||
# 2017/11/02 ||
- js
- JSON.stringify() 与 Object.prototype.toString() 的区别
- sql
- unique key 是否默认有索引
- -webkit-scrollbar
# 2017/11/03 ||
- zipkin
# 2017/10/31 ~ 2017/10/05 (week 39)
- zipkin 如何监测每一个阶段的耗时
- what's sinon
# 2017/11/06 |||
- postman debug
- 如何console.log
- 如何查看network (opens new window)
- make
- canvas
- dpi
- createImageData
- 压缩图片
- 如何获取图片大小
- img.naturalWidth
- img.naturalHeight
- 如何从 data-url 转化为 Image
- https://stackoverflow.com/questions/4773966/drawing-an-image-from-a-data-url-to-a-canvas
- const img = new Image(); img.src = data_url
- 如何获取图片
- new FileReader().ReadAsDataURL()
- URL.createObjectURL(blob)
- 压缩原理
- 如何获取图片大小
- mocha / jest
- 限速原理
# 2017/11/07
- 如何测试有副作用的函数
- index.html 缓存时间
- FILE / BLOB / ARRAYBUFFER
- safari 不支持svg透明度,标签icon不支持svg
- Blob 与 File 大小不一致
# 2017/11/08
- sql mode
- API容错性
- 当字段传过来为空时,当不存在处理
- 当部分字段传过来错误时,当不存在处理
- service-worker
- gitlab
- gitlab-runner list
- gitlab-runner register
- gitlab-runner --debug run
# 2017/11/09
- Issues
- mocha
- growl
- re
- www.baidu.com
- baidu.com
# 2017/11/06 ~ 2017/11/12 (week 40)
- what's nock
- 与
mocha
相比,ava
的局限性在哪里 - code -> 如何把数组分为两者一组,三者一组
# 2017/11/13
- python
- encoding -> ''
# 2017/11/14
db.Score.aggregate([{$group: { _id: '$dir', scores: { $push: '$$ROOT' } }}])
- plan
- coding
- canvas-concept-canvas-origin-clean (opens new window)
- canvas
- canvas cross-origin
- ImageBitmap
- origin-clean
- 填充图案
- createPattern
- canvas cross-origin
# 2017/11/15
- canvas fill 的颜色与实际颜色不一致
- Even Odd Rule (opens new window)
- 使用canvas画圆角矩形 (opens new window)
- insert into select
# 2017/11/16
- expect([1, 2]).to.include.members([1, 2, 2, 1])
- 测试数组中所有元素都相等
# 2017/11/17
- 代码约束与容错性
- re
- /[\]/.test('')
- https://stackoverflow.com/questions/3115150/how-to-escape-regular-expression-special-characters-using-javascript
# 2017/11/19
- canvas 截屏方案
- resolution
- window.devicePixelRatio
- 物理像素 : CSS 像素
- DPI -> dot per inch
- window.devicePixelRatio
- egg
- egg 对POST参数异常报422的错误
- 那么对 GET qs 参数异常报什么错误
- ci 是
- egg 对POST参数异常报422的错误
- sql
- 检索数据并从1开始递增1的方式为每行编号
select *, (select count(*) from student s2 where s2.id <= s1.id) no from student s1;
set @n = 1; select *, @n := @n + 1 no from student;
- 检索数据并从1开始递增1的方式为每行编号
- vim
- syntastics
- 如何避免对 html 不执行语法检查
- let g:syntastic_html_checkers = ['eslint']
- 如何避免对 html 不执行语法检查
- syntastics
# 2017/11/20
# 2017/11/22
- https://www.zhihu.com/question/25255678/answer/263173570
# 2017/11/23
- html5
- 如何从 svg code 转变为图像
- Blob([data], 'image/svg+xhtml')
- 如何从 svg code 转变为图像
# 2017/11/24
- 解决 HiDPI canvas 失真的问题
- https://www.html5rocks.com/en/tutorials/canvas/hidpi/
# 2017//11/27
- generator
# 2017/12/03
- 80 张牌,有2张2万,从里边抽十张包含两张2万的概率是多少
- A(78, 8) / A(80, 10)
# 2017/12/04
- FullScreen API
- 如何判断浏览器是否最大化或者全屏
- 如何确定 Element 的大小
- 全屏模式后无法侦测 page visibilitychange
- nginx = ws proxy
# 2017/12/05
- node
- Buffer
const b = Buffer('abc'); b.toString('hex')
- TypedArray
- Unit8Array
- ArrayBuffer
- Buffer
- org
- svgwg
- htmlwg
- whatwg
- w3
- svg
- gradientUnits
- userSpaceOnUse
- objectBoundingBox
- [https://svgwg.org/svg2-draft/pservers.html#RadialGradientElementFXAttribute]
- radialGradient(cx, cy, cr, fx, fy, fr)
- fr 是什么鬼
- gradientUnits
# 2017/12/06
- date
- d.toISOString()
- android
- folder
- app/src/main/res -> 相当于 src/assets 吧
- drawable
- 相当于前端应用中的 /assets/images 文件夹吧
- layout/activity_my.xml
- 布局,对应 index.html 吧
- menu
- 相当于 router.js 吧
- values
- 相当于 index.scss 吧
- drawable
- app/src/main/java/com.mycompany.myfirstapp/MyActivity.java
- 相当于 index.js 吧
- app/src/main/AndroidManifest.xml
- 项目基本特征与各个组件,相当于 SAP 中的 app.js 吧
- app/build.gradle
- 编译配置文件,相当于 SAP 中的 webpack 吧
- compiledSdkVersion
- 要编译的目标 Android 版本
- applicationId
- 包名
- targetSdkVersion
- 最高版本
- minSdkVersion
- 最低版本
- app/src/main/res -> 相当于 src/assets 吧
- Instant App support
- sdk
- android list avd
- folder
- canvas
- D3.js
- three.js
- G2.js
# 2017/12/07
- Preference API
- SharedPreference API
Context ctx = getActivity()
SharedPreferences cache = ctx.getSharedPreferences(getString(R.string.preference_file_key), Context.MODE_PRIVITY)
- android
- folder
- gradleScripts
- build.gradle
- app/manifests
- AndroidManifest.xml
- app/java
- app/res
- drable
- layout
- menu
- mipmap
- values
- gradleScripts
- R
- HAXM Hardware Accelerate Execution Manager
- 在真实设备上运行
- android.os.Bundle
- ConstraintLayout
- size
- dp -> 设备独立像素
- Widgets
- TextView -> input
- inputType -> type
- t.setText('hello, world')
- Button -> button
- text
- TextView -> input
- Widgets property
- layout_width -> width
- layout_height -> height
- wrap_content -> flex: 1
- FloatingActionButton
- Snackbar
- Intent(Context, ComponentClass) -> props
- intent.putExtra('a', 3) ->
<App a={3}>
- intent.getStringExtra('a')
- startActivity(intent)
- intent.putExtra('a', 3) ->
- AppCompat
- 布局
- declaring-layout (opens new window)
- 使用 activity 加载布局 -> import 'style.scss'
super.onCreate(savedInstance)
setContentView(R.layout.main_layout)
- id -> 不需要全局唯一,但最好做到全局唯一
- android:id = "@+id/my_button"
- android:id = "@android:id/my_button"
- Button btn = findViewById(R.id.my_button)
- layout
- LinearLayout
- ConstraintLayout
- layout_width
- wrap_content flex-shrink: 1
- match_parent flex-grow: 1
- View 与 ViewGroup 的区别
- AdapterView
- Adapter 获取数据 与 React 很像
- folder
- adb
- adb devices
- java
- @override
- https://stackoverflow.com/questions/5506373/override-annotation
- 告诉编译器,表示该方法为继承的
- public static final String EXTRA_MESSAGE = "hello, world"
- static -> 静态属性
- final -> 常量
- gradle
- @override
# 2017/12/08
- 官方教程
- 无法添加向上导航
- appCompat
- v4
- v7
# 2017/12/09
- vim
- 定位到该屏幕最上方
- HLM
- zz zt zb
- c-o, c-i
- 列出 jump list
- :ju
- only
- tabonly
- 定位到该屏幕最上方
# 2017/12/11
- sql
- 唯一索引,如果有的值为空怎么办
- firebase
# 2017/12/12
- 各种版本浏览器
- 如何删除有外键约束的值
- Cascade
- Set null
# 2017/12/13
- 防止多次提交
# 2017/12/14
- jsPDF
# 2017/12/21
- Instent Run
- 查看系统字体
# 2017/12/22
- docker ignore
- print styles (opens new window)
- pdf 页头页尾
- svg addtive
- mathjax (opens new window)
# 2017/12/24
# 2017/12/26
- fetch
- cache mode
- no-cache
- reload
- cache mode
- urlencode
# 2017/12/28
- 浏览器最多可以打开多少个页面