Skip to content

Instantly share code, notes, and snippets.

View rishabhshuklax's full-sized avatar
👽

Rishabh Shukla rishabhshuklax

👽
  • Axios-IIITL
  • Lucknow
  • 13:34 (UTC +05:30)
View GitHub Profile
@rishabhshuklax
rishabhshuklax / GenericObserverNotification.js
Created May 26, 2021 19:33
Notify User upon change in any property of a certain element, takes the className as an input param for attatching the observer
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);
@rishabhshuklax
rishabhshuklax / NotifyMe.js
Last active January 18, 2022 13:09
WazirX Notification Service
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: '!!!!!!!!!!!' });
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
while(t--){
// code here
}