注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。
启动新会话:
tmux [new -s 会话名 -n 窗口名]
恢复会话:
| #!/usr/bin/env bash | |
| set -Eeuo pipefail | |
| trap cleanup SIGINT SIGTERM ERR EXIT | |
| script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) | |
| usage() { | |
| cat <<EOF | |
| Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...] |
| TypeScript 21 hrs 47 mins ████████████████▒░░░ 67.1% | |
| Vue.js 6 hrs 21 mins ██████▓░░░░░░░░░░░░░ 19.6% | |
| JSON 2 hrs 10 mins ████▒░░░░░░░░░░░░░░░ 6.7% | |
| JavaScript 46 mins ███▒░░░░░░░░░░░░░░░░ 2.4% |
| function addComments(arg, name) { | |
| // 当参数前的注释不存在的情况, 加入 webpackChunkName 注释 | |
| if (!arg.leadingComments) { | |
| arg.leadingComments = [ | |
| { | |
| type: 'CommentBlock', | |
| value: ` webpackChunkName: '${name}' `, | |
| }, | |
| ] | |
| } |
| import { ObjectOmit } from 'typelevel-ts' | |
| const get = <O, K extends keyof O>(k: K, o: O): O[K] => o[k] | |
| const set = <O, K extends keyof O>(k: K, v: O[K], o: O): O => Object.assign({}, o, { [k as any]: v }) | |
| const remove = <O, K extends keyof O>(k: K, o: O): ObjectOmit<O, K> => { | |
| const copy: any = Object.assign({}, o) | |
| delete copy[k] | |
| return copy |
How to have some fun using the terminal.
sudo apt-get install cowsaysudo apt-get install fortunesudo apt-get install figletruby -vgem install lolcatAll of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParentThis is a curated set of conventions and best practices for Stylus, an expressive, dynamic, robust and advanced CSS preprocessor. Frustrated with there not being a set of conventions set in place (that could be easily found), I set forth to find out on my own.