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
| "runtimeExecutable": "~/.nvm/versions/node/v10.16.0/bin/node" | |
| (launch.json: | |
| { | |
| // Use IntelliSense to learn about possible attributes. | |
| // Hover to view descriptions of existing attributes. | |
| // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { |
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
| docker run --network="host" image_name |
- NodeJS Weekly http://nodeweekly.com/
- Mobile Web Weekly http://mobilewebweekly.co/
- Bitcoin Weekly http://bitcoinweekly.com/
- Cloud Development Weekly http://clouddevweekly.co/
- HTML5 Weekly http://html5weekly.com/
- Javascript Weekly http://javascriptweekly.com/
- Database Weekly http://dbweekly.com/
- Web Operations Weekly http://webopsweekly.com/
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
| module.exports = ms => { | |
| return new Promise((resolve, reject) => { | |
| setTimeout(resolve, ms); | |
| }) | |
| } | |
| //EXAMPLE OF USAGE: | |
| //const promuseTimeout = request('./utils/promiseTimeout'); | |
| //(async () => { | |
| // await promiseTimeout(1000); |
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
| Kill-port: | |
| //To list any process listening to the port 8080: | |
| sudo lsof -i:8080 | |
| //To kill any process listening to the port 8080: | |
| sudo kill $(lsof -t -i:8080) | |
| //or more violently: | |
| sudo kill -9 $(lsof -t -i:8080) | |
| //(-9 corresponds to the SIGKILL - terminate immediately/hard kill) | |
| On freeze: |
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
| ### Example #1 ### | |
| $ docker ps -a | |
| CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
| 2e23d01384ac iperf-v1:latest "/usr/bin/iperf -s" 10 minutes ago Up 10 minutes 5001/tcp, 0.0.0.0:32768->5201/tcp compassionate_goodall | |
| # Append the container ID (CID) to the end of an inspect | |
| $ docker inspect --format '{{ .NetworkSettings.IPAddress }}' 2e23d01384ac | |
| 172.17.0.1 | |
| ### Example #2 ### | |
| # Add -q to automatically parse and return the last CID created. |
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
| app.disable("x-powered-by"); |
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
| module.exports = fn => { | |
| return (req, res, next) => { | |
| Promise.resolve(fn(req, res)).catch(next); | |
| } | |
| }; | |
| // EXAMPLE OF USAGE: | |
| //const catchException = require('./utils/catchException') | |
| //app.get('/', catchExceptions(async (req, res) => { | |
| // ... |
Getting started:
Related tutorials: