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
| export default function (url, options, timeout = 7000) { | |
| return Promise.race([ | |
| fetch(url, options), | |
| new Promise((_, reject) => | |
| setTimeout(() => reject(new Error('timeout')), timeout) | |
| ) | |
| ]); | |
| } |
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
| Dim WinScriptHost | |
| Set WinScriptHost = CreateObject("WScript.Shell") | |
| WinScriptHost.Run Chr(34) & "D:\...\file.cmd" & Chr(34), 0 | |
| Set WinScriptHost = Nothing |
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
| # JetBrains IDEs # | |
| ################### | |
| /.idea/* | |
| *.iml | |
| # Compiled source # | |
| ################### | |
| *.com | |
| *.class | |
| *.dll |
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
| // Sequence of numbers | |
| val xs = Seq(1, 5, 3, 4, 6, 2) | |
| // Sort using Natural ordering as defined for Integers in Scala Library | |
| xs.sorted //1,2,3,4,5,6 | |
| // Sort 'with' a comparator function | |
| xs.sortWith(_<_) //1,2,3,4,5,6 | |
| xs.sortWith(_>_) //6,5,4,3,2,1 | |
| xs.sortWith((left,right) => left > right) //6,5,4,3,2,1 |