Skip to content

Instantly share code, notes, and snippets.

View theshubhagrwl's full-sized avatar
🎯
Building

Shubh Agrawal theshubhagrwl

🎯
Building
View GitHub Profile
#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"};
# 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;
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)
#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)
@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:
@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 / 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