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 branch | grep -v "master\|develop" | xargs git branch -D |
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 http = require("http"); | |
| const fs = require("fs"); | |
| const server = http.createServer((req, res) => { | |
| fs | |
| .createReadStream(process.argv[3]) | |
| .on("data", data => res.write(data)) | |
| .on("end", () => res.end()); | |
| }); |
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 http = require("http"); | |
| const url = process.argv[2]; | |
| http.get(url, response => { | |
| response.setEncoding("utf8"); | |
| response.on("data", data => console.log(data)); | |
| }); |
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 fs = require("fs"); | |
| const dir = process.argv[2]; | |
| const ext = process.argv[3]; | |
| fs.readdir(dir, (error, files) => { | |
| if (error) throw error; | |
| const re = new RegExp(`\.${ext}$`); | |
| files.map(file => { |
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 arr = ('1,2,3').split(',') | |
| //arr equals [ 1, 2, 3 ] |