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
| /** | |
| * reactive context | |
| * | |
| * @Why 解决provide无法reactive的问题 | |
| * | |
| * eg: | |
| * | |
| * data: () => ({ | |
| * items: ['item 1', 'item 2], | |
| * message: 'A reactive message' |
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
| const getImageFileSize = (file) => new Promise((resolve, reject) => { | |
| const image = new Image() | |
| image.src = window.URL.createObjectURL(file) | |
| image.onerror = reject | |
| image.onload = () => { | |
| const width = image.naturalWidth | |
| const height = image.naturalHeight | |
| window.URL.revokeObjectURL(image.src) | |
| resolve({ width, height }) | |
| } |
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 mapValues(obj, fn) { | |
| return Object.keys(obj).reduce((result, key) => { | |
| result[key] = fn(obj[key], key); | |
| return result; | |
| }, {}); | |
| } | |
| function pick(obj, fn) { | |
| return Object.keys(obj).reduce((result, key) => { | |
| if (fn(obj[key])) { |
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
| sudo brew uninstall node | |
| brew update | |
| brew upgrade | |
| brew cleanup | |
| brew install node | |
| sudo chown -R $(whoami) /usr/local | |
| brew link --overwrite node | |
| # post-install 安装后 | |
| brew postinstall node |
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
| git config --global http.proxy http://127.0.0.1:8123 | |
| git config --global https.proxy https://127.0.0.1:8123 | |
| git config --global --unset http.proxy | |
| git config --global --unset https.proxy |