Skip to content

Instantly share code, notes, and snippets.

View Dhravya's full-sized avatar
🚀
Building things!

Dhravya Shah Dhravya

🚀
Building things!
View GitHub Profile
text = """
ipsum doloridk sit amet, consectetur adipiscing elit.
sed non risus.adiidkidk
suspendisse lectus tortor,adi dignissim sit amet, adipiscing nec, ultricies sed, dolor.
cras elementum ultrices diam.idkidkidk maecenas ligula massa, varius a, semper congue, euismod non, mi. """
txt1 = "loremhehe loremhehe lorem ipsumhehe ipsum ipsum"
def find_all_non_overlapping_repeating_substrings(text: str):
@Dhravya
Dhravya / owofy.ts
Last active January 20, 2023 12:34
Gist Created in Script Kit
function owofy(text: string, wanky: boolean = false) {
function lastReplace(s: string, old: string, newVal: string): string {
const i = s.lastIndexOf(old);
if (i < 0) {
return s;
}
const start = s.substring(0, i);
const end = s.substring(i + old.length);
return start + newVal + end;
}
@Dhravya
Dhravya / bot.py
Last active October 18, 2023 14:57
A simple twitter bot using Twitter API v2
import pytwitter
from os import environ as env
from dotenv import load_dotenv
load_dotenv() # Loads the .env file we created earlier
api = pytwitter.Api(
consumer_key=env["CONSUMER_KEY"],
consumer_secret=env["CONSUMER_SECRET"],
access_token=env["OAUTH_TOKEN"],
@Dhravya
Dhravya / music.py
Created January 27, 2022 17:14
A music cog with spotify support based on FFMPEG for discord.py
import asyncio, functools, itertools, math, random
import spotipy, youtube_dl, discord, lyricsgenius
from spotipy.oauth2 import SpotifyClientCredentials
from async_timeout import timeout
from discord.ext import commands
from otherfiles.utils import voteembed, Votelink
from typing import Sequence
def strong_british_accent(
text: Sequence
):
"""Converts your given string/array to a kind-of strong british accent (if you're nonsensical about it...)
"""
def brit(brsentence):
brsentence = brsentence.replace("it was ", "it was quite ")
from typing import Sequence
import random
def owofy(text: Sequence, *, wanky: bool = False):
"""translates your given text to owo!
"""
def last_replace(s, old, new):
li = s.rsplit(old, 1)
return new.join(li)
@Dhravya
Dhravya / meaning.py
Created September 13, 2021 07:38
Hourly word and meaning toast giver & Notification reminder
from pkg_resources import working_set
from random_word import RandomWords
from win10toast import ToastNotifier
import time
from PyDictionary import PyDictionary
r = RandomWords()
x = 0
word = r.get_random_word(hasDictionaryDef="true")
@Dhravya
Dhravya / numerology.py
Created September 13, 2021 07:37
Numerology app for mom ❤
```
added:
Minor GUI Changes
Numeroscope finder
missing numbers finder
To be added :
Number of occurences counter
Test to find out results
way to display the numeroscope in a better way
Beautification of GUI
@Dhravya
Dhravya / tictactoe.py
Created September 13, 2021 07:35
TicTacToe with GUI
#Multiplayer and single player
# Tic Tac Toe game with GUI
# using tkinter
# importing all necessary libraries
import random
import tkinter
from tkinter import *
from functools import partial
@Dhravya
Dhravya / sudoku.py
Created September 13, 2021 07:34
Sudoku Generator and game with gui
import pygame #pip install pygame
import time
from sudokugen.generator import generate, Difficulty #pip install sudokugen
from inputimeout import inputimeout, TimeoutOccurred #pip install inputimout
import os
new_puzzle = generate(difficulty=Difficulty.MEDIUM)
def chunk(l, n):
n = max(1, n)
return (l[i:i+n] for i in range(0, len(l), n))