Skip to content

Instantly share code, notes, and snippets.

View Geograph-us's full-sized avatar
🇺🇦
no war

Geograph Geograph-us

🇺🇦
no war
View GitHub Profile
byte[] EliasFanoCompress(ulong[] UlongsArray)
{
long maxCompressedSize = (long)((2 + Math.Ceiling(Math.Log((double)UlongsArray[UlongsArray.Length - 1] / (double)UlongsArray.Length, 2))) * UlongsArray.Length / 8) + 6;
byte[] compressedBuffer = new byte[maxCompressedSize];
ulong compressedBufferPointer2 = 0;
ulong compressedBufferPointer1 = 0;
UInt64 lastID = 0;
UInt64 buffer1 = 0;
UInt64 bufferLength1 = 0;
@Geograph-us
Geograph-us / No Audio in Sterm.io patch.md
Created September 27, 2023 15:30
Stremio No sound fix on Windows
  1. Using HEX-editor edit stremio.exe. Change string "terminal" to "config\x00\x00" to allow load mpv.conf
  2. Open/create %appdata%\mpv\mpv.conf and add parameter audio-channels = stereo
@Geograph-us
Geograph-us / PPM.cs
Last active May 10, 2022 03:12
Compression by PPM + Arithmetic Coder C# implementation (based on C++ algorithm from the book "Data Compression Methods")
//The context compressor, author M.Smirnov.
//The source also can be found at
//http://compression.ru/
//usage:
//c infile outfile //encoding
//d infile outfile //decoding
/*
* Контекстный компрессор Dummy, автор М.Смирнов.
* Исходный текст этой программы также можно найти на сайо
@Geograph-us
Geograph-us / MyMemoryOfUs.md
Last active May 17, 2021 11:36
"My Memory of Us" 21:9 UltraWide Screen Fix

"My Memory of Us" 21:9 UltraWide Screen Fix

Using any HEX-Editor (for example HxD) open a file: "My Memory of Us\mmou_Data\Managed\Assembly-CSharp.dll"

Find HEX-bytes: 39 8E E3 3F. There are 24 matches in the file

Need to replace matches #10 and #19 at addresses 0x0003B01F and 0x00050CF2

Replace with bytes depending on the resolution:
26 B4 17 40 for 21:9 (2560x1080)\

@Geograph-us
Geograph-us / get_twitter_followers.js
Created February 17, 2020 21:48
Get twitter followers using browser console
// Open twitter-followers page
// Open browser-console and paste this script
// Click on page for stop script
// When script done you can use global variables window.text or window.followersSet
// for example copy to clipboard
// copy(window.text);
var scrollTimer;
window.followersSet = new Set();
window.text = "";
@Geograph-us
Geograph-us / qiwi_send.sh
Last active August 16, 2019 12:59
Отправка через Qiwi API
api_key="0000000000000000000000000000000" # API-ключ https://qiwi.com/api
pay_to="+77085205652" # кому платим
amount="15" # сумма
currency="840" # 840 - доллары, 978 - евро, 643 - рубли, 398 - тенге
comment="abcde" # код от телеграмм бота
curl -X POST 'https://edge.qiwi.com/sinap/api/v2/terms/99/payments' \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${api_key}" \
@Geograph-us
Geograph-us / main.cs
Last active August 6, 2019 15:16
nc sly.kz 8181
const int serverPort = 8181;
const string serverAddress = "sly.kz";
void Main()
{
using (var client = new TcpClient(serverAddress, serverPort))
using (var networkStream = client.GetStream())
using (var sr = new StreamReader(networkStream))
{
var maxWins = 50;