active iTerm2 if not focus on iTerm2 else open a new tab
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function.prototype.call = function (context, ...args) { | |
context = context === undefine || context === null ? window : Object(context) | |
const fn = Symbol('fn') | |
context[fn] = this | |
const result = context[fun](...args) | |
delect context[fn] | |
return result | |
} | |
Function.prototype.apply = function (context, args = []) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# delect all brew (and cask) cache | |
rm -rf "$(brew --cache)" | |
# update all brew (and cask) formulae from repo | |
# /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula | |
# /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask/Casks | |
brew update -v | |
# brew upgrade single terminal command | |
brew upgrade proxychains-ng |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://nbconvert.readthedocs.io/en/latest/usage.html | |
# notebook: notebook 文件绝对地址,结尾扩展名 .ipynb | |
# target_name: 输出目标文件名,无后缀名,根据 type 自动对应生成 | |
# format: 渲染格式 - asciidoc, custom, html, latex, markdown, notebook, pdf, python, rst, script, slides | |
# render_dir: 输出目录绝对路径 | |
python -m nbconvert -y \ | |
--ExecutePreprocessor.kernel_name="${jupyter_kernel}" \ | |
--ExecutePreprocessor.timeout=-1 \ | |
--execute "${notebook}" \ | |
--output-dir "${render_dir}" \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* compile react component to both es and commonjs modules, | |
* with typescript and less in css modules | |
* | |
* @type {Gulp} | |
*/ | |
const gulp = require('gulp') | |
const babel = require('gulp-babel') | |
const ts = require('gulp-typescript') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* simulate import GPU from gpu.js and export forceLayout function | |
*/ | |
import { GPU } from 'gpu.js' | |
// vector2 functions | |
function add(v1, v2) { | |
return [ | |
v1[0] + v2[0], |
View | Tool Windows | Structure
https://www.jetbrains.com/help/phpstorm/viewing-structure-of-a-source-file.html
Move To | Right Bottom
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .gitattributes or .git/info/attributes | |
# https://git-scm.com/docs/git-config#Documentation/git-config.txt-coreattributesFile | |
*.[jt]s filter=ignoreLogStage | |
*.[jt]sx filter=ignoreLogStage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# curl https://get.acme.sh | sh | |
# https://dash.cloudflare.com/profile/api-tokens | |
export CF_Token="xxxxxx" | |
# https://dash.cloudflare.com/<account_id> | |
export CF_Account_ID="xxxxxx" | |
acme.sh --issue --dns dns_cf -d zthxxx.me -d '*.zthxxx.me' | |
mkdir -p /etc/nginx/ssl/zthxxx.me |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 443 ssl; | |
listen [::]:443 ssl; | |
server_name <xxxx.xxx>; | |
# acem: https://gist.github.com/zthxxx/b37cddcb17395e395ad6b430a81edd61 | |
# cloudflare: https://dash.cloudflare.com/<account_id>/<domain_name>/ssl-tls/origin | |
ssl_certificate /etc/nginx/ssl/<xxxx.xxx>/fullchain.cer; | |
ssl_certificate_key /etc/nginx/ssl/<xxxx.xxx>/privkey.key; |