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
@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
@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-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 / 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 / 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==
{
"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 / mega-exclusions.md
Last active July 20, 2025 07:20
How to ignore any file or folder from Mega sync backup?

mega-exclusions.png

image
@g-rohit
g-rohit / promises.js
Last active March 1, 2024 22:14
Handling Promises in Javascript using Async Await, Fetch and Promise constructor.
/**
* Asynchronous function to fetch internet facts from a JSON API.
* @returns {Promise<void>} A Promise that resolves when the facts are fetched and logged.
*/
async function getFacts() {
try {
// Fetch data from the internet_facts.json API
const API = await fetch(
"https://gist.githubusercontent.com/g-rohit/a4c4c49b85c71bff69738e9ad0e44da9/raw/1e74b775a2efcf1cca8b066da45aa0d28c2ac096/internet_facts.json"
);
@g-rohit
g-rohit / internet_facts.json
Last active January 29, 2024 06:42
Random 20 Internet Facts
{
"internet_facts": [
"The first ever website was published on August 6, 1991, by Tim Berners-Lee.",
"The first email was sent by Ray Tomlinson in 1971.",
"The concept of the World Wide Web was proposed by Tim Berners-Lee in 1989.",
"Google processes over 40,000 search queries every second on average.",
"The internet requires 50 million horsepower to keep running in current state.",
"The most common use of the internet is sending and receiving email.",
"YouTube is the second largest search engine on the internet, after Google.",
"There are over 1.7 billion websites on the internet as of 2021.",
@g-rohit
g-rohit / uses--by-grohit.json
Last active September 19, 2023 22:51
Uses by G Rohit
[
{
"Name": "Antivirus",
"ApplicationName": "Bitdefender Antivirus Free",
"URL": "https://www.bitdefender.com/solutions/free.html",
"tags": "utilities"
},
{
"Name": "Break time reminder",
"ApplicationName": "Stretchly",