// Allow 'unsafe-inline'
System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "sandbox; default-src 'none'; img-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline';")
// Verify the setting
System.getProperty("hudson.model.DirectoryBrowserSupport.CSP")
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
// Credit: https://gist.github.com/malko/d3dee36e7d0d927654439f4c01c8ca0c | |
function fluentProxy (target, promise = Promise.resolve()) { | |
return new Proxy(target, { | |
get(target, property) { | |
if (target[property] instanceof Function) { | |
return (...args) => fluentProxy(target, promise.then(() => target[property](...args))); | |
} | |
} | |
}); |
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 request = require('request'); | |
function fetch(url) { | |
return new Promise(function(resolve) { | |
request(url, function(error, response, body) { | |
resolve(JSON.parse(body)); | |
}); | |
}); | |
} |
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
// Credit: https://github.com/Microsoft/WinAppDriver/issues/588 | |
node { | |
powershell ''' | |
# Start WinAppDrive | |
Start-Process -FilePath cmd -ArgumentList '/c WinAppDriver.exe 1>WinAppDriver.log 2>WinAppDriver_ERR.log' -WindowStyle Hidden | |
# Run UI Test | |
vstest.console.exe 'bin\\Debug\\CalculatorTest.dll' | |
''' |
Package requirement:
- browsermob-proxy==0.8.0
- selenium==3.9.0
Usgae: python dump_har.py 'https://www.google.com' | grep mp3
m3u8_to_mp4() {
url=${1}
filename=${2}
ffmpeg -i $url -c copy -bsf:a aac_adtstoasc $filename
}
Usage: m3u8_to_mp4 ${url} ${filename}
Sample: Wait for Service
Wait loginComplete = new Wait() {
@Override
public Boolean apply() {
return Service.isLogin() == true;
}
};
Wait.until(loginComplete);
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
alias screensaver='open /System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app' |