Skip to content

Instantly share code, notes, and snippets.

View vijayhardaha's full-sized avatar
💻
Working on WordPress

Vijay Hardaha vijayhardaha

💻
Working on WordPress
View GitHub Profile
@vijayhardaha
vijayhardaha / instagram-auto-like.md
Created March 14, 2025 00:51
Instagram Auto-Like Script

This JavaScript code automatically likes all posts on Instagram by clicking the "Like" buttons at 2-second intervals. Once all posts are liked, an alert will notify the user that the task is complete. This script targets Instagram's DOM structure and ensures each like action is performed with a slight delay for a smooth user experience.

Code:

var elements = document.querySelectorAll('article section div[role="button"][tabindex="0"] svg title');
var likeButtons = [];

elements.forEach(function(el) {
    if (el.innerHTML.toLowerCase().trim() === 'like') {
@vijayhardaha
vijayhardaha / facebook-posts-autolike.md
Last active March 12, 2025 02:18
Auto Click "Like" Buttons at Intervals

This JavaScript snippet selects all "Like" buttons on a webpage that meet specific attribute criteria and clicks them at 2-seconds intervals. It ensures that only buttons with the visible text "Like" are clicked.

Code:

var elements = document.querySelectorAll('div[aria-label="Like"][role="button"] span[data-ad-rendering-role="like_button"]');
var likeButtons = [];

elements.forEach(function(el) {
    if (el.innerText.toLowerCase().trim() === 'like') {
@vijayhardaha
vijayhardaha / discover-and-clean-up-plugin-generated-custom-post-meta-keys-and-options.md
Created October 6, 2023 11:13
Discover and Clean Up Plugin-Generated Custom Post Meta Keys and Options

Discover and Clean Up Plugin-Generated Custom Post Meta Keys and Options

When managing WordPress plugins, it's crucial to identify and remove any lingering custom post meta keys and options created by plugins you no longer use. This custom shell function, scan-plugin-meta-options-keys(), simplifies the process of searching for and identifying these meta keys and options within your WordPress database.

How to Use the Function in Your Shell Configuration Files

You can add the scan-plugin-meta-keys() function to your shell configuration files (e.g., .bashrc, .bash_profile, or .zshrc) to make it available each time you start a new terminal session. Here's how to add and utilize the function in your shell configuration:

  1. Open Visual Studio Code or your preferred code editor.
@vijayhardaha
vijayhardaha / effortless-node-js-cleanup-remove-package-lock-files-and-node-modules.md
Last active October 6, 2023 11:04
Effortless Node.js Cleanup: Remove Package Lock Files and node_modules Folder

Node.js Cleanup: Remove Package Lock Files and node_modules Folder

If you've worked with Node.js projects, you're probably familiar with the package-lock.json, yarn.lock, pnpm-lock.yaml files, and the node_modules folder. While these are essential for managing dependencies, they can take up significant space and sometimes need a clean slate.

Here's a handy alias that removes these files and the node_modules folder from the current directory:

alias rm-node-modules='rm -v package-lock.json yarn.lock pnpm-lock.yaml && rm -rfv node_modules'
@vijayhardaha
vijayhardaha / alias-for-removing-ds-store-files.md
Last active October 6, 2023 11:03
Effortless Cleanup: Removing .DS_Store Files Recursively with One Command

Alias for Removing .DS_Store Files

If you're a macOS user, you've probably come across those pesky .DS_Store files that macOS creates to store metadata about directories. These files can clutter your file system, and sometimes you just want to get rid of them.

Here's a useful alias that finds and deletes all .DS_Store files within the current directory and its subdirectories, while providing verbose output so you can see which files are being removed:

alias rm-dsstore='find . -name ".DS_Store" -type f -exec rm -v {} \;'
@vijayhardaha
vijayhardaha / reinstall-wordpress-core-skip-content-forcefully.md
Last active September 24, 2023 19:09
Reinstall WordPress Core (Skip Content) Forcefully

Reinstall WordPress Core (Skip Content) Forcefully

Occasionally, you might need to reinstall the WordPress core files without affecting your website's content. This alias, wp-reinstall, simplifies the process of downloading and reinstalling the WordPress core files, excluding the content directory, to ensure a fresh core installation.

How to Use the Alias

You can use the wp-reinstall alias in your terminal to trigger the WordPress core reinstallation. Here are the steps:

  1. Open Your Terminal: Launch your terminal or command prompt.
@vijayhardaha
vijayhardaha / get-and-copy-your-public-ip-addresses-in-cli.md
Created September 24, 2023 19:01
Get and Copy Your Public IP Addresses in the Command Line

Get and Copy Your Public IP Addresses in the Command Line

Frequently, you might need to retrieve and use your public IP addresses in various scenarios. These aliases, ip6 and ip4, simplify the process of obtaining your public IPv6 and IPv4 addresses and copying them to your clipboard.

How to Add and Use the Aliases in Your Shell Configuration Files

You can add the ip6 and ip4 aliases to your shell configuration files (.bashrc, .bash_profile, or .zshrc) for convenient access in every terminal session. Follow these steps to add and use the aliases in your shell configuration:

  1. Open Visual Studio Code or your preferred code editor.
@vijayhardaha
vijayhardaha / find-all-git-repositories-in-cli.md
Created September 24, 2023 18:59
Find All Git Repositories in a directory using the Command Line

Find All Git Repositories within a directory using the Command Line

When working with multiple Git repositories in various directories, it's helpful to quickly locate them within the command line. This custom shell function, find-git-dirs(), allows you to search for all Git repositories in the current directory and its subdirectories.

How to Use the Function in Your Shell Configuration Files

You can add the find-git-dirs() function to your shell configuration files (.bashrc, .bash_profile, or .zshrc) to make it available each time you start a new terminal session. Here's how to add and utilize the function in your shell configuration:

  1. Open Visual Studio Code or your preferred code editor.
@vijayhardaha
vijayhardaha / find-large-size-files-in-cli.md
Created September 24, 2023 18:56
Find Large Size Files in the Command Line

Find Large Size Files in the Command Line

When managing your files and directories in the command line, it's important to locate and manage large files that may be consuming significant storage space. This custom shell function, find-large-files(), enables you to search for files larger than a specified size.

How to Use the Function in Your Shell Configuration Files

You can add the find-large-files() function to your shell configuration files (.bashrc, .bash_profile, or .zshrc) to make it available each time you start a new terminal session. Here's how to add and utilize the function in your shell configuration:

  1. Open Visual Studio Code or your preferred code editor.
@vijayhardaha
vijayhardaha / find-large-size-directories-in-cli.md
Created September 24, 2023 18:55
Find Large Size Directories in the Command Line

Find Large Size Directories in the Command Line

When managing your files and directories in the command line, it's often useful to identify large directories that may be consuming a significant amount of storage space. This custom shell function, find-large-dirs(), allows you to search for directories larger than a specified size.

How to Use the Function in Your Shell Configuration Files

You can add the find-large-dirs() function to your shell configuration files (.bashrc, .bash_profile, or .zshrc) to make it available every time you start a new terminal session. Follow these steps to add and use the function in your shell configuration:

  1. Open Visual Studio Code or your preferred code editor.