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
| ssh-keygen -t rsa | |
| echo "alias myserver='ssh [email protected]'" >> $HOME/.bashrc | |
| cat $HOME/.ssh/id_rsa.pub | ssh [email protected] 'cat >> .ssh/authorized_keys' | |
| source $HOME/.bashrc | |
| myserver |
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
| var webpack = require('webpack'); | |
| var path = require('path'); | |
| module.exports = { | |
| devtool: 'inline-source-map', | |
| entry: [ | |
| 'webpack-dev-server/client?http://127.0.0.1:8080/', | |
| 'webpack/hot/only-dev-server', | |
| './src' | |
| ], |
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 capitalize(str) { | |
| return str.replace(/\b\w/g, l => l.toUpperCase()) | |
| .replace(/\s/g, ''); | |
| } |
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 resolveObject(promisesObject) { | |
| const data = {}; | |
| let ready = Promise.resolve(null); | |
| Object.keys(promisesObject).forEach((name) => { | |
| const promise = promisesObject[name]; | |
| ready = ready.then(() => promise) | |
| .then((value) => { | |
| data[name] = value; | |
| }); | |
| }); |
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 times = [ 1, 3, 4, 2 ]; | |
| const sleep = ms => | |
| new Promise(res => { | |
| const t = ms * 1000; | |
| setTimeout(res, t) | |
| }) | |
| const myPromise = num => | |
| sleep(num).then(() => { |
OlderNewer