Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Acquiring Skills

Shubh Agrawal theshubhagrwl

🎯
Acquiring Skills
View GitHub Profile
View Microsoft.PowerShell_profile.ps1
#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 Nov 12, 2021
Update oh-my-posh custom theme
View oh-my-posh-updated.json
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"background": "#c386f1",
"foreground": "#ffffff",
"properties": {
@theshubhagrwl
theshubhagrwl / ohmyposhtheme.json
Last active Nov 12, 2021
My theme for oh-my-posh
View ohmyposhtheme.json
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"background": "#c386f1",
"foreground": "#ffffff",
"leading_diamond": "",
View Tic Tac Toe in Brainfuck
+[----->+++<]>+.---.+++++++..+++.[--->+<]>--.[->+++<]>.+++++.-----------.+++++++++.+++++++++.+[->+++<]>++.+.--[--->+<]>-.--[->++<]>.-[--->+<]>.++++++.++++.+.--.-------------.----.++++++++++++.---[->+++<]>.>++++++++++..[--------->++<]>+.--.----------.+++++.-------.-[--->+<]>--.+[----->+<]>+.-------------.++++++++++++.--------.[--->+<]>----.---.[----->++<]>+.++.++.--[--->+<]>-.---[->++++<]>-.+.++[->+++<]>++.[----->+++<]>-.>++++++++++..-[->++++<]>-.--[->+++<]>+.+.+.+++.+++++.---------.--[--->+<]>-.[-->+++++<]>.----.-----------.+[--->++++<]>+.[----->+<]>.+++++++++++++.>-[----->+<]>--.-[--->++<]>.[-->+++<]>+.>++++++++++.-[->++++<]>-.--[->+++<]>+.+.+.+++.+++++.---------.--[--->+<]>-.[-->+++++<]>.----.-----------.+[--->++++<]>+.[----->+<]>.+++++++++++++.>-[----->+<]>-.--[--->++<]>.[-->+++<]>++.>++++++++++..--[----->+<]>+.+++++.++++++.[---->+<]>+++.--[->++++<]>-.+[->+++<]>.+++++++.++++.++++[->+++<]>.>-[--->+<]>-.-[--->+<]>++++.---.----.[-->+<]>++++.>++++++++++.+[--------->+<]>.+.--.---------.+++++.-------.-[--->+<]>-
View RandomNumber.py
from time import time
milliseconds = str((time() * 1000))
print(milliseconds[-6])
View xplorweb.html
<!DOCTYPE html>
<html>
<head>
<title>Sign Up Form</title>
<style>
form {
max-width: 800px;
margin: 10px auto;
padding: 10px 20px;
background: #f4f7f8;
@theshubhagrwl
theshubhagrwl / custom_user_model.py
Created Aug 16, 2020
Custom User Model in Django
View custom_user_model.py
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:
View LSRecursive.cpp
#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)
View LSIterative.cpp
#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)
View playlist-time-calc.py
# 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)