Skip to content

Instantly share code, notes, and snippets.

@uoziod
uoziod / console-promise.js
Last active August 29, 2015 14:22
Output promise data to console
.then(console.log.bind(console));
const combine = (...arrays)
=> [].concat(...arrays);
const compact = arr
=> arr.filter(el => el);
const contains = (() => Array.prototype.includes
? (arr, value) => arr.includes(value)
: (arr, value) => arr.some(el => el === value)
)();
var myScript = document.createElement('script');
myScript.src = 'http://code.jquery.com/jquery-2.1.4.min.js';
myScript.onload = function() {
console.log('jQuery loaded.');
};
document.body.appendChild(myScript);
@uoziod
uoziod / before-unload.js
Last active August 26, 2017 01:41
Prevent page unloading in Google Chrome (useful with cyclic redirects debugging)
window.addEventListener("beforeunload", function() { debugger; }, false);