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
| private static final long SEED = 2873123; | |
| private static final Random RANDOM = new Random(SEED); | |
| RANDOM.nextInt(3) | |
| //result will be one of 0,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
| ss |
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
| JSONObject jsonObject = new JSONObject(String.format("{\"lower\":%d, \"upper\":%d}", lower, upper)); | |
| String ratingFilterInput = Util.encodeValue(jsonObject.toString()); |
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 map = new Map(); | |
| map.set('first', 'hello'); | |
| map.set('second', 'world'); | |
| for (let [key, value] of map) { | |
| console.log(key + " is " + 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
| { | |
| "workbench.colorTheme": "Oceanic Next (dimmed bg)", | |
| "files.autoSave": "onFocusChange", | |
| "editor.minimap.enabled": true, | |
| "workbench.statusBar.visible": true, | |
| "workbench.activityBar.visible": true, | |
| "editor.formatOnSave": false, | |
| "workbench.colorCustomizations": { | |
| "statusBar.background": "#333333", |
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 clearFolder = directory => { | |
| fs.readdir(directory, (err, files) => { | |
| if (err) throw err; | |
| for (const file of files) { | |
| fs.unlink(path.join(directory, file), err => { | |
| if (err) throw err; | |
| }); | |
| } | |
| }); |
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
| urls=("http://way-api.rdc-dev.moveaws.com/prod/hptest" "http://way-api.rdc-dev.moveaws.com/prod/srptest" "http://way-api.rdc-dev.moveaws.com/prod/ldptest" "http://way-api.rdc-dev.moveaws.com/beta/hptest" "http://way-api.rdc-dev.moveaws.com/beta/srptest" "http://way-api.rdc-dev.moveaws.com/beta/ldptest") | |
| for url in "${urls[@]}" | |
| do | |
| curl "$url" | |
| done |
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
| _getAllStaticRDCData = () => { | |
| var self = this; | |
| axios | |
| .all([ | |
| this.getStaticRDCData("hp"), | |
| this.getStaticRDCData("srp"), | |
| this.getStaticRDCData("ldp") | |
| ]) | |
| .then( | |
| axios.spread(function(hp, srp, ldp) { |
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 getMostRecentLocalFileName(dir) { | |
| var files = fs.readdirSync(dir); | |
| return _.max(files, function(f) { | |
| var fullpath = path.join(dir, f); | |
| return fs.statSync(fullpath).ctime; | |
| }); | |
| } |
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 get(url) { | |
| return new Promise((resolve, reject) => { | |
| fetch(url) | |
| .then(res => res.json()) | |
| .then(data => resolve(data)) | |
| .catch(err => reject(err)); | |
| }); | |
| } | |
| #example |
OlderNewer