ifconfig 
lsof 
ssh 
ping
cat 
vi/vim 
less \
| #!/bin/bash | |
| # Aliases added to shell | |
| alias vi='vim' | |
| alias pg='ps aux|grep' | |
| alias ll='ls -alFh' | 
| // This is used to check if native JavaScript methods are overridden by a third-party source | |
| function checkObject() { | |
| ['assign', 'create', 'defineProperty', 'defineProperties', 'entries', 'freeze', | |
| 'getOwnPropertyDescriptor', 'getOwnPropertyNames', 'getOwnPropertySymbols', | |
| 'getPrototypeOf', 'is', 'isExtensible', 'isFrozen', 'isSealed', 'keys', | |
| 'preventExtensions', 'seal', 'setPrototypeOf', 'values'].forEach(method => { | |
| if (!Object[method]) { | |
| console.warn(`Object.${method} method is missing.`); | |
| } else if (Object[method].toString() !== `function ${method}() { [native code] }`) { // For Safari, the code is `function ${method}() {\n [native code]\n}` | 
Drag in an image file, automatically generates icons for iPhone/Mac/Android of all sizes.
| In MySQL 5.7, it uses auth_socket for authentication if we don't provide root password when installing MySQL. We can use below code to swith back to password authentication: | |
| ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'MyNewPassword'; | |
| For details, see: https://www.percona.com/blog/2016/03/16/change-user-password-in-mysql-5-7-with-plugin-auth_socket/ | 
| const HttpProxyAgent = require('http-proxy-agent'); | |
| const proxyServer = 'http://corporate.proxy:8080'; | |
| ... | |
| '/api': { | |
| target: 'http://a.b.c', | |
| secure:false, | |
| pathRewrite: {'^/api':''}, | |
| agent:new HttpProxyAgent(proxyServer), | |
| } | 
| 1. 注册微信支付商户号 | |
| 2. 购买域名并备案,然后在微信商户号中进行配置 | |
| 3. 注册微信开放平台账号,申请App/网站应用,并进行开发者资质认证 | |
| 4. 在微信支付商户号中关联开放平台的App ID | |
| 5. 开发对接 | 
| void DebugOut(wchar_t *fmt, ...) | |
| { | |
| va_list argp; | |
| va_start(argp, fmt); | |
| wchar_t dbg_out[4096]; | |
| vswprintf_s(dbg_out, fmt, argp); | |
| va_end(argp); | |
| OutputDebugString(dbg_out); | |
| } |