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" | 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
| // CSVToMap takes a reader and returns an array of dictionaries, using the header row as the keys | |
| func CSVToMap(reader io.Reader) []map[string]string { | |
| r := csv.NewReader(reader) | |
| rows := []map[string]string{} | |
| var header []string | |
| for { | |
| record, err := r.Read() | |
| if err == io.EOF { | |
| break |
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 main() { | |
| console.log(name); | |
| console.log(age); | |
| var name = "Asnim P Ansari"; | |
| let age = 23; | |
| } | |
| main(); |
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
| for (var i = 0; i < 3; i++) { | |
| setTimeout(() => console.log(i), 1); | |
| } | |
| for (let i = 0; i < 3; i++) { | |
| setTimeout(() => console.log(i), 1); | |
| } |
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 shape = { | |
| radius: 10, | |
| diameter() { | |
| return this.radius * 2; | |
| }, | |
| perimeter: () => 2 * Math.PI * this.radius | |
| }; | |
| shape.diameter(); | |
| shape.perimeter(); |
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
| +true; | |
| !"Asnim"; |
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
| [..."Asnim"]; |
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
| !!null; | |
| !!""; | |
| !!1; |
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
| [[0, 1], [2, 3]].reduce( | |
| (acc, cur) => { | |
| return acc.concat(cur); | |
| }, | |
| [1, 2] | |
| ); |
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
| (() => { | |
| let x, y; | |
| try { | |
| throw new Error(); | |
| } catch (x) { | |
| (x = 1), (y = 2); | |
| console.log(x); | |
| } | |
| console.log(x); | |
| console.log(y); |
OlderNewer