This file contains 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
# path | |
# C:\Program Files\PowerShell\7 | |
function set_proxy { | |
$proxy = 'http://127.0.0.1:7890' | |
# temporary | |
$env:HTTP_PROXY = $proxy | |
$env:HTTPS_PROXY = $proxy |
This file contains 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 cancable(p) { | |
var cancel; | |
var promise = new Promise((resolve, reject) => { | |
p.then(resolve, reject); | |
cancel = reject; | |
}); | |
return { | |
promise: promise, | |
cancel: cancel | |
}; |