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
const notifyMe = (className, title = 'Room status changed', body = 'Someone entered the room') => { | |
var target = $(`.${className}`); | |
const observer = new MutationObserver(function(mutations) { | |
const notification = new Notification(title, { body }); | |
}); | |
// configuration of the observer: | |
const config = { attributes: true, childList: true, characterData: true }; | |
// pass in the target node, as well as the observer options | |
observer.observe(target, config); |
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
const notifyMe = (className, limitArray) => { | |
let target = $(`.${className}`), | |
config; | |
const observer = new MutationObserver(function() { | |
let value = target.innerText; | |
value = parseInt(value.split('.')[0].slice(1).replace(/,/g, ''), 10); | |
if (value < limitArray[1] && value > limitArray[0]) { | |
const notification = new Notification('OK!!', { body: '!!!!!!!!!!!' }); |
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
#include<bits/stdc++.h> | |
using namespace std; | |
int main(){ | |
int t; | |
cin >> t; | |
while(t--){ | |
// code here | |
} |