Skip to content

Instantly share code, notes, and snippets.

View g-rohit's full-sized avatar
🎯
Focusing

G Rohit g-rohit

🎯
Focusing
View GitHub Profile
{
"budget_trips": [
{
"Alleppey": "The Venice Of The East",
"Goa": "The Land Of Beaches",
"Pondicherry": "The French Town",
"Gokarna": "The Less Crowded Goa",
"Rishikesh": "The Yoga Capital",
"Darjeeling": "The Land Of Thunderbolt",
"McLeodganj": "The Little Lhasa",
@g-rohit
g-rohit / removeSponsorAds.js
Created December 5, 2024 06:39
Removes sponsor ads on the MoneyControl mutual funds page.
// ==UserScript==
// @name Remove Sponsor Ads
// @namespace http://tampermonkey.net/
// @version 2024-12-05
// @description Removes sponsor ads on the MoneyControl mutual funds page.
// @author You
// @match https://www.moneycontrol.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=moneycontrol.com
// @grant none
// ==/UserScript==
@g-rohit
g-rohit / get-all-chapter-and-topic-names-from-udemy.js
Created May 18, 2025 09:40
This code snippet gets all the chapter names and sub topic names in a checkbox or todo markdown style from udemy course
// given a condition all the sections are expanded
(function () {
function sanitize(text) {
return text?.trim().replace(/\s+/g, ' ') || '';
}
const sections = document.querySelectorAll('[data-purpose^="section-panel-"]');
const markdownLines = [];
sections.forEach((section) => {
@g-rohit
g-rohit / get-google-photos-album-names.js
Last active July 22, 2025 09:21
Get Google photo album names
// Run this in the browser console while logged into Google Photos Albums page
(function() {
let albumNames = [];
const links = document.getElementsByTagName('A');
for (let i = 0; i < links.length; i++) {
const link = links[i];
// Google Photos albums usually show count like '123 items' in their text; skip those links
if (/\b\d+ items\b/.test(link.innerText)) {
const divs = link.getElementsByTagName('DIV');
@g-rohit
g-rohit / add-count-to-folder-name.bat
Last active July 20, 2025 10:26
Add file count to folder name
@echo off
setlocal EnableDelayedExpansion
:: Set your root folder path
cd /d "C:\Path\To\Your\Folders"
for /d %%F in (*) do (
set "folderName=%%F"
set "fileCount=0"
@g-rohit
g-rohit / get-all-folders-from-box.com.js
Created July 23, 2025 02:40
Get all the folder names from the box.com website
(()=>{
// Select all row elements that represent folders by their data attributes or visible content
const folderRows = document.querySelectorAll('div[data-item-index]');
// Extract folder names from anchor tags within those rows
const folderNames = [];
folderRows.forEach(row => {
// The folder name seems inside: div > div.item-list-name > div.item-name-holder > div.name-row > div.item-name > a.item-link