Skip to content

Instantly share code, notes, and snippets.

View MarshalX's full-sized avatar
🦁

Ilya Siamionau MarshalX

🦁
View GitHub Profile
@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 / mergeSort.py
Last active October 13, 2019 11:27
Merge Sort on Python
import random
def merge_sort(a):
n = len(a)
if n < 2:
return a
l = merge_sort(a[:n//2])
r = merge_sort(a[n//2:n])
@MarshalX
MarshalX / quickSort.py
Created October 13, 2019 11:36
Quick Sort on Python
# coding=utf-8
import random
n = 10
A = [random.randint(0, 10) for i in range(0, n)]
def partition(array, start, end):
pivot = array[(start + end) // 2]
@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 / quickSort.cs
Created October 13, 2019 11:40
Quick sort on C#
using System;
namespace cSharp {
class Program {
static int partition(int[] A, int start, int end) {
int pivot = A[(start + end) / 2];
int i = start;
int j = end;
while (i <= j) {
@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);
@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 / 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 / error_database.diff
Last active August 8, 2022 08:26
Telegram API Error Databse diff
https://t.me/tgcrawl
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": [