Skip to content

Instantly share code, notes, and snippets.

View sboyina's full-sized avatar

Srinivasa Rao Boyina sboyina

View GitHub Profile
@sboyina
sboyina / jonsnow.js
Last active July 31, 2020 06:55
Watches whether the url is healthy (200)
(() => {
let endWatch = () => {};
const log = (msg, color) => {
console.log('%c Jon Snow %c ' + msg, 'color: white;background: black;padding: 5px 2px;', 'color:' + color);
};
log('Hello there.', 'green');
window.JONSNOW = {
'watch': (url, interval) => {
window['JONSNOW'] && window.JONSNOW.end();
interval = interval || 60 * 1000;