This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", | |
"blocks": [ | |
{ | |
"alignment": "left", | |
"segments": [ | |
{ | |
"background": "#c386f1", | |
"foreground": "#ffffff", | |
"properties": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |