Skip to content

Instantly share code, notes, and snippets.

View onstash's full-sized avatar

Santosh Venkatraman onstash

  • Likewyss Technologies
  • Bengaluru, India
View GitHub Profile
@onstash
onstash / delete-nth-item-in-notebooklm.js
Last active June 14, 2025 11:56
Delete Nth item in NotebookLM
(async function deleteNthNotebookLMItem() {
try {
// Prompt user for number of items to delete
const userInput = prompt("How many items do you want to delete?", "0");
// Handle cancel (returns null) or invalid input
if (userInput === null) {
throw new Error("Operation cancelled by user");
}
@onstash
onstash / highlight2ndDegreeConnections.js
Last active August 19, 2025 16:54
Highlight 2nd degree connections using MutationObserver
(function () {
'use strict';
// Configuration constants
const CONFIG = {
SELECTORS: {
DEGREE_BADGE: '.social-details-reactors-modal >* .artdeco-entity-lockup__degree',
CONTAINER: '.social-details-reactors-modal'
},
DEGREE_TEXT: '2nd',
@onstash
onstash / react-query-lite.tsx
Last active May 8, 2025 11:43
react-query-lite.tsx
import React, { createContext, useContext, useEffect, useReducer, useRef } from 'react';
import type { ReactNode } from 'react';
// @ts-expect-error
const context = createContext<QueryClient>();
export function QueryClientProvider({
client,
children,
(function getProductsListOfNamesLinksPrices() {
const containerQuery = "div.horizontal-type__product_details";
const products = Array.from(document.querySelectorAll(containerQuery)).map(
(containerNode) => {
try {
const linkNode = containerNode.querySelector("div > a");
const nameContainerNode = linkNode.querySelector(
"div.horizontal-type__product_name",
);
const quantityNode = nameContainerNode.querySelector(
@onstash
onstash / GetListOfItemsAsMarkdownTable.js
Created January 18, 2025 15:18
Get list of items as Markdown Table
(function () {
const markdownTableStrArr = [
"|Product Name\t|Link\t|Price\t|",
"|---|---|---|",
...Array.from(document.querySelectorAll(".mini-type__product_details")).map(
(x) => {
const link = x.querySelector("a");
return `|${link.querySelector("div.mini-type__product_name").innerText}|${link.href}|${x.nextSibling.innerText.split(" ").join("")}`;
},
),
@onstash
onstash / GetLinkedInProfileContactInfo.js
Last active September 20, 2024 04:18
GetLinkedInProfileContactInfo.js
/**
* @param {{debug: boolean}} options
* @returns {Promise<void>}
*/
(function getContactInfo(options) {
/**
*
* @param {`${string}-${number}`}_birthday
* @returns
*/
@onstash
onstash / .git-fetch-checkout-pull.sh
Created August 10, 2024 16:40
Script that can be used as an alias: gfc <branch_name> (or) gfc <branch_name> drop_stash
#!/bin/sh
current_branch_name=$(git rev-parse --abbrev-ref HEAD)
# Check if $1 is empty
if [ -z "$1" ]; then
# Fallback to the current Git branch name
echo "[WARN] 1st argument is empty, falling back to current_branch_name: $current_branch_name"
branch_name=$current_branch_name
else
# Use the provided argument as the branch name
@onstash
onstash / adjustVideoSpeed.js
Last active November 20, 2021 10:31
Adjust HTML5 video playback speed
(function adjustVideoPlaybackSpeed(options) {
var video = document.querySelector("video");
if (!video) return window.alert("No video available in page");
newPlaybackRate = options && typeof options === 'object' && options.playbackRate && typeof options.playbackRate === 'number' ? options.playbackRate : 1;
video.playbackRate = newPlaybackRate;
video.play();
if (newPlaybackRate === 1) window.confirm("Video playback speed is now default speed");
if (newPlaybackRate > 1) window.confirm("Video playback speed is now " + newPlaybackRate + " times the normal speed");
})({playbackRate: 1.5});
@onstash
onstash / media-query.css
Created February 21, 2018 05:33
Media queries for responsive web design
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
}