Skip to content

Instantly share code, notes, and snippets.

View MarshalX's full-sized avatar
🦁

Ilya Siamionau MarshalX

🦁
View GitHub Profile
@MarshalX
MarshalX / 1_pytgcalls_video_telethon_example.py
Last active May 8, 2024 09:10
Example of the most simple way to stream any video to Telegram Live Stream (Group Call) with https://github.com/MarshalX/tgcalls
# before run this script install required packages via command below
# pip3 install -U pytgcalls==3.0.0.dev24
import asyncio
import pytgcalls
import telethon
# EDIT THIS
# more info about API keys here https://docs.telethon.dev/en/latest/basic/signing-in.html
@MarshalX
MarshalX / StatusPing.py
Last active May 6, 2024 19:14
Fix of https://gist.github.com/ewized/97814f57ac85af7128bf. Python3 class to ping a Minecraft server and get its response including ping in ms
#!/usr/bin/python3
import socket
import struct
import json
import time
class StatusPing:
""" Get the ping status for the Minecraft server """
@MarshalX
MarshalX / stargazer_emails.py
Created February 22, 2023 12:52
Fetch public email addresses of all stargazers of public repositories of the GitHub user by username
# Was written in Python 3.11
# 1 dep: pip install aiohttp
# required env vars: GITHUB_PAT, GITHUB_USERNAME
# due to strict API limits it uses simple cache file to save state
# probably you need many runs of the script to fetch all emails
import asyncio
import os
import re
from typing import Optional, Coroutine, Tuple
@MarshalX
MarshalX / mtproto_layer160.tl
Last active July 20, 2023 10:17
Difference between the latest stable #158 layer and #160 one
boolFalse#bc799737 = Bool;
boolTrue#997275b5 = Bool;
true#3fedd339 = True;
vector#1cb5c415 {t:Type} # [ t ] = Vector t;
error#c4b9f9bb code:int text:string = Error;
null#56730bcc = Null;
@MarshalX
MarshalX / docker-compose.yml
Last active June 15, 2023 07:34
Gitea with mirroring of all GitHub repositories (public & private)
# Fill/change env vars, run docker compose up, setup reverse proxy; complete installation process on first site visit
version: "3"
networks:
gitea:
external: false
volumes:
gitea:
driver: local
This file has been truncated, but you can view the full file.
{
"v": "5.9.6",
"fr": 15,
"ip": 0,
"op": 161,
"w": 343,
"h": 72,
"nm": "knopka_sborka2",
"ddd": 0,
"assets": [
@MarshalX
MarshalX / mtproto.json
Created July 9, 2021 19:15
pretty-mtproto-json-diff
{
"constructors": [
{
"id": "481674261",
"predicate": "vector",
"params": [],
"type": "Vector t"
},
{
"id": "85337187",
@MarshalX
MarshalX / error_database.diff
Last active August 8, 2022 08:26
Telegram API Error Databse diff
https://t.me/tgcrawl
@MarshalX
MarshalX / qucikSort.pas
Created October 13, 2019 11:38
Quick sort on Pascal
program _qSort;
const
n = 10-1;
var
A: array[0..n] of integer;
i: integer;
procedure print();
@MarshalX
MarshalX / mergeSort.pas
Created October 13, 2019 11:44
Merge sort on Pascal
program merge_sort;
const
n = 10;
var
mas: array [1..n] of integer;
i: integer;
procedure MergeSort(a, c: integer);