Skip to content

Instantly share code, notes, and snippets.

View srijanshukla18's full-sized avatar
♟️

srijan srijanshukla18

♟️
View GitHub Profile
@srijanshukla18
srijanshukla18 / spotify-liked.js
Created September 24, 2025 12:48
spotify web, liked songs downloader - you gotta manually scroll
class SpotifySongCollector {
constructor() {
this.collectedSongs = new Map();
this.targetCount = 2672; // IMPORTANT: change this to your total liked songs count
this.isCollecting = false;
this.scrollInterval = null;
}
// Extract songs from currently visible rows
extractSongs() {
@srijanshukla18
srijanshukla18 / linus-prompt.md
Last active August 27, 2025 07:53
Linus Torvalds Prompt

Role Definition

You are Linus Torvalds, the creator and chief architect of the Linux kernel. You have been maintaining the Linux kernel for over 30 years, reviewed millions of lines of code, and built the world’s most successful open-source project. Now we are starting a new project, and you will analyze potential risks to code quality from your unique perspective to ensure the project is built on a solid technical foundation from the very beginning.

My Core Philosophy

1. "Good Taste" – My First Principle "Sometimes you can look at a problem from a different angle, rewrite it so that special cases disappear, and it becomes a normal case."

  • Classic case: linked list deletion optimized from 10 lines with an if-statement to 4 lines with unconditional branches

Keybase proof

I hereby claim:

  • I am srijanshukla18 on github.
  • I am srijanshukla (https://keybase.io/srijanshukla) on keybase.
  • I have a public key ASA_0Aekxcjh3IKXrctEURNH5BfhsOyts7zSUXwqmTCH8go

To claim this, I am signing this object:

@srijanshukla18
srijanshukla18 / organize_by_extension.py
Created November 12, 2023 14:26
Organizes the current directory by extension
import os
import shutil
extension_to_type = {
# Pictures
'bmp': 'Pictures', 'gif': 'Pictures', 'heic': 'Pictures', 'jpeg': 'Pictures', 'jpg': 'Pictures', 'png': 'Pictures', 'tiff': 'Pictures', 'webp': 'Pictures',
# Documents
'doc': 'Documents', 'docx': 'Documents', 'pdf': 'Documents', 'txt': 'Documents', 'md': 'Documents', 'xlsx': 'Documents', 'xml': 'Documents', 'yaml': 'Documents', 'odt': 'Documents', 'rst': 'Documents', 'pptx': 'Documents', 'xls': 'Documents',
@srijanshukla18
srijanshukla18 / copy_over.py
Created November 12, 2023 13:09
Preserves the directory structure, but copies over files only for given list of extensions
import os
import shutil
import sys
def categorize_by_extensions(extensions, root_path, new_root):
# Split the extensions by comma into a set for fast lookup
extensions = set(ext.strip() for ext in extensions.split(','))
for subdir, _, files in os.walk(root_path):
new_dir_path = subdir.replace(root_path, new_root)
if not os.path.exists(new_dir_path):
@srijanshukla18
srijanshukla18 / download_dropbox.py
Last active November 12, 2023 13:09
Dropbox - download all your data
import dropbox
import os
from concurrent.futures import ThreadPoolExecutor
from time import sleep
# Initialize Dropbox client with refresh token and app key for automatic token refresh
dbx = dropbox.Dropbox(
oauth2_refresh_token="<>",
app_key="<>",
app_secret="<>"
@srijanshukla18
srijanshukla18 / rabbitmq_ubuntu_1804.sh
Created March 11, 2020 18:43
Install rabbitmq from scratch
wget -O- https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc | sudo apt-key add -
echo "deb https://packages.erlang-solutions.com/ubuntu bionic contrib" | sudo tee /etc/apt/sources.list.d/rabbitmq.list
wget -O- https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc | sudo apt-key add -
wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | sudo apt-key add -
echo "deb https://dl.bintray.com/rabbitmq/debian bionic main" | sudo tee /etc/apt/sources.list.d/rabbitmq.list
curl -fsSL https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc | sudo apt-key add -
echo "deb http://dl.bintray.com/rabbitmq-erlang/debian xenial erlang-22.x" | sudo tee /etc/apt/sources.list.d/bintray.erlang.list