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 iframeURLChange(iframe, callback) { | |
var unloadHandler = function () { | |
// Timeout needed because the URL changes immediately after | |
// the `unload` event is dispatched. | |
setTimeout(function () { | |
callback(iframe.contentWindow.location.href); | |
}, 0); | |
}; | |
function attachUnload() { |
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
/// <reference path='typings/index.d.ts' /> | |
import * as _ from 'lodash' | |
declare module 'lodash' { | |
// tslint:disable-next-line:interface-name | |
interface LoDashStatic { | |
chunkBy <T> (array: T[], predicate: (element: T) => boolean): T[][] | |
} | |
} | |
_.mixin({ | |
chunkBy <T> (array: T[], predicate: (element: T) => boolean): T[][] { |
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 mySlowFunction(baseNumber) { | |
console.time('mySlowFunction'); | |
let result = 0; | |
for (var i = Math.pow(baseNumber, 7); i >= 0; i--) { | |
result += Math.atan(i) * Math.tan(i); | |
}; | |
console.timeEnd('mySlowFunction'); | |
} | |
mySlowFunction(8); // higher number => more iterations => slower |
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
import jenkins.model.* | |
import com.cloudbees.plugins.credentials.* | |
import com.cloudbees.plugins.credentials.common.* | |
import com.cloudbees.plugins.credentials.domains.* | |
import com.cloudbees.plugins.credentials.impl.* | |
import com.cloudbees.jenkins.plugins.sshcredentials.impl.* | |
import hudson.plugins.sshslaves.*; | |
domain = Domain.global() | |
store = Jenkins.instance.getExtensionList('com.cloudbees.plugins.credentials.SystemCredentialsProvider')[0].getStore() |