Skip to content

Instantly share code, notes, and snippets.

View nikhilbhatt's full-sized avatar
🎯
Focusing

Nikhil Bhatt nikhilbhatt

🎯
Focusing
View GitHub Profile
@nikhilbhatt
nikhilbhatt / bookmarks_code.txt
Last active February 2, 2025 08:08
Skip You Tube Ad script
javascript:(function(){setInterval(()=>{const skipButton = document.querySelector('.ytp-ad-skip-button'); const adOverlay= document.querySelector('.ytp-ad-overlay-close-container'); if(adOverlay !=undefined) adOverlay.click(); if(skipButton != undefined) skipButton.click();}, 2000)})();
@nikhilbhatt
nikhilbhatt / gsscript
Created November 19, 2022 20:17
App script code to create API from google sheets
function doGet(req) {
let spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
let personalDetails = spreadsheet.getSheetByName('personal-details'); //sheet name is personal-details
let personalDetailsValues = personalDetails.getDataRange().getValues(); //reading the sheet data(2D array of sheet data)
/*
personalDetailsValues output
[ [ 'First Name', 'Nikhil' ],
[ 'Last Name', 'Bhatt' ],
[ 'Email', '[email protected]' ] ]
@nikhilbhatt
nikhilbhatt / Email Cleaner
Created April 29, 2023 19:18
Google App Script to Delete emails permanently
function searchMails(searchQuery) {
return GmailApp.search(searchQuery, 0, 100);
}
function moveEmailsToTrash(emailThread) {
emailThread.moveToTrash();
}
function deleteEmailsPermanently(emailThread) {
Gmail.Users.Threads.remove('me', emailThread.getId());