Skip to content

Instantly share code, notes, and snippets.

View theshubhagrwl's full-sized avatar
🎯
Building

Shubh Agrawal theshubhagrwl

🎯
Building
View GitHub Profile
@theshubhagrwl
theshubhagrwl / clean_node_modules.sh
Created January 10, 2026 05:29
Remove Node Modules Bash Script
#Print all the target folders
find . -type d -name "node_modules" -prune -print
# Print and delete the files
find . -type d -name "node_modules" -prune -print -exec rm -rf {} +
#Skip directories with -prune
find . \
-path "./futwork-ai" -prune -o \
-type d -name "node_modules" -prune \
async function wait(ms) {
return new Promise((res) => setTimeout(res, ms));
}
async function one() {
console.log('one start');
await wait(1000);
console.log('one end');
}
async function two() {
@theshubhagrwl
theshubhagrwl / Microsoft.PowerShell_profile.ps1
Last active July 9, 2023 06:28
Powershell profile script
#Taken from https://github.com/shanselman
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
#Import-Module PSColors
#Import-Module posh-git
@theshubhagrwl
theshubhagrwl / oh-my-posh-updated.json
Created November 12, 2021 11:54
Update oh-my-posh custom theme
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"background": "#c386f1",
"foreground": "#ffffff",
"properties": {
@theshubhagrwl
theshubhagrwl / custom_user_model.py
Created August 16, 2020 03:15
Custom User Model in Django
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, PermissionsMixin
class UserManager(BaseUserManager):
def create_user(self, email, password=None):
"""
Creates and saves a User with the given email and password.
"""
if not email:
#include <iostream>
using namespace std;
void linearSearch(int a[],int n,int x,int index)
{
if(index >=n)
{
cout << "Not Found" << endl;
}
else if(a[index] == x)
#include <iostream>
using namespace std;
int main()
{
int a[10] = {1,7,3,1,4,6,2,3,5,86};
int x = 2;
for (int i = 0; i < 10; ++i)
{
if(a[i]==x)
# This script will calculate the time needed to watch a youtube playlist.
# The only condition is that the playlist should be public
import requests
import html5lib
from bs4 import BeautifulSoup
str = input("Enter a link of a public youtube playlist: ")
URL = str
r = requests.get(URL)
#include <iostream>
using namespace std;
#define Player1 1
#define Player2 2
int whoseTurn;
string moves[3] = {"empty", "cross", "zero"};
string board[9] = {"empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty"};