Skip to content

Instantly share code, notes, and snippets.

View itssoap's full-sized avatar
:octocat:
Encoding anime

Soap itssoap

:octocat:
Encoding anime
View GitHub Profile
@itssoap
itssoap / kafkaproducer.py
Last active February 1, 2024 20:53
Dummy Kafka Producer using Confluent Kafka
"""
Benchmarking Kafka on cloud to understand the latency and throughput
with async and sync when >>> acks=all
AKHQ used for checking the Topic
Future goal will be implementing this around a proper Avro schema
"""
import orjson
from confluent_kafka import Producer, version, libversion
import time
from telethon.sync import TelegramClient, events
from io import BytesIO
from PIL import Image
api_id = ''
api_hash = ''
phone_number = ''
destination_channel_username = '@eternalcropped'
client = TelegramClient('session_name', api_id, api_hash)
@itssoap
itssoap / codon.sh
Last active May 30, 2023 07:18
Convenience script to build Codon
#!/bin/bash
sudo apt install -y ninja-build cmake unzip
git clone --depth 1 -b codon https://github.com/exaloop/llvm-project
cmake -S llvm-project/llvm -B llvm-project/build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_ENABLE_RTTI=ON \
from fastapi import FastAPI, Request
from fastapi.responses import HTMLResponse, Response
from fastapi.staticfiles import StaticFiles
from fastapi_redis_cache import FastApiRedisCache, cache
import httpx
import os
headers = {
'Accept': '*/*',
'Accept-Language': 'en-US,en;q=0.9',
// ==UserScript==
// @name Soap's PTP - Export collection to CSV
// @namespace http://tampermonkey.net/
// @version 1.6
// @description Add a button to export a whole collection to a .csv (imdb id, title, year, director, tags)
// @author Sapphire_e, Chameleon
// @include /^https?:\/\/passthepopcorn.me\/collages.php.*(\?|&)id=(\d*).*/
// @grant none
// ==/UserScript==
@itssoap
itssoap / alias.bat
Created February 19, 2023 18:58
An attempt to make simple aliases in Windows
@echo off
set temp1=
set temp2=
set _strings=%*
echo %_strings%
for /f "tokens=1 delims==" %%a in ("%_strings%") do (
import httpx
from dataclasses import dataclass
import json
from typing import Union
error_codes: dict = {
"10001": "service temporarily unavailable",
"10002": "missing CF-Ray header",
"10003": "missing account public ID",
"10004": "missing account tag",
from fastapi import FastAPI
import httpx
from pycountry import countries
from random import randrange
app = FastAPI()
@app.get("/")
async def getter() -> str:
headers = {
from bs4 import BeautifulSoup as bs
import httpx
import requests
import aiohttp
import asyncio
import time
from pathlib import Path
from slowpoke import downloader
from warnings import warn
from tokenize import String
import requests
from requests import Session
from requests_toolbelt import MultipartEncoder
import traceback
from typing import Any, List, NoReturn, Optional, Type, NamedTuple, Dict, Iterable, Union
from os import PathLike
import colorama
import sys
from pathlib import Path