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
const pairs = [] | |
async function cheating() { | |
let elements = document.getElementsByClassName("mobile-items")[0] | |
let amount = elements.children.length | |
for (let sender = 0; sender < amount; sender++){ | |
for (let receiver = 0; receiver < amount; receiver++){ | |
if (pairs.includes(sender.toString() + receiver.toString()) || pairs.includes(receiver.toString() + sender.toString())){ | |
continue; | |
} |
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
# this example is based on https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.run_in_executor | |
import asyncio | |
import time | |
from telegram import Update | |
from telegram.ext import Application, CommandHandler, ContextTypes, MessageHandler, filters | |
def blocking_io(): | |
# File operations (such as logging) can block the |
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
var Layout = require("Layout"); | |
var clockLayout = new Layout( { | |
type:"txt", font:"15%", label:"Hello World", id:"clock", | |
}); | |
const utils = { | |
random_element: function(array) { | |
return array[Math.floor(Math.random() * array.length)];} | |
}; |
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
// this while loop is active as long as the user didn't input anything or | |
// their input is out of range | |
while (validation == 0) { | |
validation = scanf_s("%d", &day); | |
// this if is true when either the input is wrong (no number given) | |
// or when the number is too low/high | |
if (validation != 1 || day < 1 || day > 31) { | |
// if validation is 0, the input buffer exists, so I DESTROY it | |
while ((c = getchar()) != '\n' && c != EOF); | |
printf("\nSorry, this was the wrong input. You need to give an \ |
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 telegram import InlineKeyboardButton, InlineKeyboardMarkup, Update | |
from telegram.ext import Updater, CommandHandler, CallbackQueryHandler, CallbackContext | |
def navigation_buttons_generator(index: str): | |
navigation_buttons = [[InlineKeyboardButton("⏪", callback_data="minus_" + index), | |
InlineKeyboardButton("⏩", callback_data="plus_" + index)]] | |
return InlineKeyboardMarkup(navigation_buttons) | |
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 io | |
def downloader(bot, url, timeout=None): | |
# if you receive a timeout error, pass an increasing timeout until you don't | |
buf = bot.request.retrieve(url, timeout=timeout) | |
# turning the byte stream into a file_like object without actually writing it to a file | |
file_like = io.BytesIO(buf) | |
# and returning it | |
return file_like |
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 logging | |
from telegram import InlineKeyboardButton, InlineKeyboardMarkup | |
from telegram.ext import Updater, CommandHandler, CallbackQueryHandler | |
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', | |
level=logging.INFO) | |
def start_command(update, context): |
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 asyncio | |
from telegram.ext import Updater, MessageHandler, Filters | |
from telethon.utils import resolve_bot_file_id, get_input_location | |
from telethon import TelegramClient | |
import logging | |
logging.basicConfig() |
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
~version: "2.0" | |
# this IV is a pretty basic example for a pretty basic website. LET'S GO | |
?exists: //meta[@content="article"] | |
# very easy way to determine if our IV should be generated or not. Works well. | |
body: //article | |
title: $body//h1[1] | |
channel: "@PresseEifel" | |
# basic variables, its their official channel, so we set it as well. | |
author: //a[@rel="author"] | |
author_url: //a[@class="url fn n"]/@href |