This file contains hidden or 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
#!/bin/bash | |
# Capture the start time | |
start_time=$(date +%s) | |
# Telegram bot token and chat ID | |
bot_token="<TOKEN HERE>" | |
chat_id="<CHAT ID HERE>" | |
# MongoDB base command | |
mongodump_base_command="mongodump --uri=\"mongodb://< URI HERE >"" |
This file contains hidden or 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
import { GPUStatsPanel } from 'three/addons/utils/GPUStatsPanel.js'; | |
import Stats from 'three/addons/libs/stats.module.js'; | |
import { useThrelte } from '@threlte/core'; | |
const { scene, renderer } = useThrelte(); | |
const stats = new Stats(); | |
document.body.appendChild(stats.dom); | |
const gpuPanel = new GPUStatsPanel(renderer.getContext()); | |
stats.addPanel(gpuPanel); |
This file contains hidden or 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 datetime import datetime | |
import time , os | |
import pyautogui | |
import pygetwindow as gw | |
from skimage import io, metrics | |
import os | |
# Define a function to compare images using SSIM |
This file contains hidden or 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
def padd_str(text, to_chars, push_r: bool = False, push_l: bool = False): | |
"""Padds the string given with spaces to a certain char count ( like setw() in cpp )""" | |
if len(text) < to_chars: | |
excess = to_chars - len(text) | |
if push_r: # we pad to the left of text | |
text = ' ' * excess + text | |
elif push_l: # we pad to the right of text | |
text = text + ' ' * excess | |
else: # we dont pad if no direction |
This file contains hidden or 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
await event.delete() | |
entitty = await ubi.get_entity('<id here>') | |
quotes = ubi.iter_messages(entity=entitty,from_user="@QuotLyBot") | |
count = 0 | |
stk = [] | |
async for quote in quotes: | |
if quote.message == '': | |
print(quote.stringify()) | |
if isinstance(quote.media, MessageMediaDocument): | |
# print(quote.media.document.id) |
This file contains hidden or 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
"""Add colors to print""" | |
class C: | |
black = '\033[30m' | |
red = '\033[31m' | |
green = '\033[32m' | |
yellow = '\033[33m' | |
orange = '\033[34m' | |
purple = '\033[35m' | |
blue = '\033[36m' | |
white = '\033[37m' |
This file contains hidden or 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
import cv2 | |
import os | |
import asyncio | |
import math | |
from PIL import Image | |
from telethon import events | |
from telethon.tl.types import MessageMediaPhoto , MessageMediaDocument, DocumentAttributeAnimated | |
from colorthief import ColorThief |