Skip to content

Instantly share code, notes, and snippets.

View inneroot's full-sized avatar

Gleb F inneroot

View GitHub Profile
@inneroot
inneroot / convertWrongEncode.py
Created March 24, 2025 11:50
Convert wrong encoded cyrilic 'windows-1251' to 'utf-8"
def fix_double_encoded_cyrillic(garbled_text):
# Step 1: Get the raw bytes of the garbled text (as UTF-8)
raw_bytes = garbled_text.encode('latin1') # Preserves exact byte values
# Step 2: Convert bytes to hex list (for debugging)
hex_bytes = [hex(b) for b in raw_bytes] # ['0xc2', '0xe2', '0xe5', ...]
# Step 3: Reinterpret the bytes as Windows-1251 (Cyrillic)
fixed_text = raw_bytes.decode('windows-1251') # Correct decoding
return fixed_text
@inneroot
inneroot / dockerization.yml
Created August 21, 2024 14:49
Build and push docker contaienr to dockerhub
# .github/workflows/dockerization.yml
name: Build release Docker image
on:
push:
jobs:
docker:
runs-on: ubuntu-latest
steps:
@inneroot
inneroot / small-vim-keys-ascii.txt
Last active July 19, 2023 13:40
small vim arrow keys ASCII created in ASCII_Art_Paint
β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’
β–ˆβ–ˆβ–ˆβ–“β–“β–ˆβ–ˆβ–“β–“β–ˆβ–ˆβ–“
β–ˆβ–ˆβ–ˆβ–“β–“β–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–“
β–ˆβ–ˆβ–ˆβ–“β–“β–ˆβ–ˆβ–“β–“β–ˆβ–ˆβ–“
β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘
β–ˆβ–ˆβ–“β–“β–ˆβ–ˆβ–“β–“β–ˆβ–ˆβ–‘β–’β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–’β–‘β–ˆβ–ˆβ–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
β–ˆβ–’β–ˆβ–ˆβ–“β–“β–“β–“β–“β–“β–ˆβ–ˆβ–‘β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–‘β–ˆβ–ˆβ–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–ˆ
β–ˆ β–’β–ˆβ–ˆβ–“β–“β–ˆβ–ˆβ–“β–“β–ˆβ–ˆβ–‘β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–‘β–ˆβ–ˆβ–“β–“β–“β–“β–“β–“β–ˆβ–ˆβ–’ β–ˆ
β–ˆ β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–“β–ˆβ–ˆβ–ˆβ–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘ β–ˆ
β–ˆ β–‘β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–‘β–ˆβ–ˆβ–ˆβ–“β–“β–ˆβ–ˆβ–“β–“β–ˆβ–ˆβ–ˆβ–‘β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–‘ β–ˆ
@inneroot
inneroot / vim-keys-ascii.txt
Last active July 19, 2023 13:27
vim arrow keys ASCII created in ASCII_Art_Paint
β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘
β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘
β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–“β–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–‘
β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–“β–“β–“β–ˆβ–ˆβ–ˆβ–“β–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘
β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–“β–“β–“β–“β–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘
β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–“β–“β–“β–ˆβ–ˆβ–ˆβ–“β–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘
β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–“β–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–‘
β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–‘β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–‘β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘
β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–’β–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–“β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–‘
β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–’β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–‘
@inneroot
inneroot / arrow-keys-ascii.txt
Last active July 19, 2023 13:19
arrow keys ASCII created by ASCII_Art_Paint
β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘
β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘
β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘
β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–“β–“β–“β–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘
β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘
β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘
β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘
β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–‘β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–‘β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘
β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–’β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–‘
β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–“β–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–’β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–“β–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–‘
@inneroot
inneroot / hollow-knight-head-accii-art.txt
Last active July 19, 2023 12:05
hollow knight head ASCII created by ASCII_Art_Paint
β–‘β–’β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–‘
β–‘β–’β–’β–ˆβ–“β–’ β–’β–’β–“β–ˆβ–‘β–‘
β–‘β–‘β–’β–ˆβ–ˆβ–“β–“β–“ β–“β–“β–“β–“β–ˆβ–ˆβ–‘β–‘
β–‘β–’β–ˆβ–“β–’β–‘ β–‘β–“β–ˆβ–’β–‘
β–‘β–’β–ˆβ–“β–’β–‘ β–‘β–“β–ˆβ–’β–‘
β–‘β–’β–ˆβ–“β–’β–’ β–‘β–’β–“β–ˆβ–’β–‘
β–‘β–’β–ˆβ–ˆβ–“β–“β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–“β–“β–ˆβ–ˆβ–‘
β–‘β–‘β–’β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–‘
β–‘β–‘β–’β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–‘
β–‘β–’β–’β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–’β–‘
@inneroot
inneroot / fox-accii-art.txt
Created July 19, 2023 09:02
Fox ASCII Art created by ASCII_Art_Paint
β–“β–“β–“β–“β–“ β–“β–“β–“β–“β–“
β–“β–“β–“β–“β–“β–“β–“β–“β–“ β–“β–“β–“β–“β–“β–“β–“β–“β–“
β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“ β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“
β–“β–“β–“β–“ β–‘β–‘β–“β–“β–“β–“β–“β–“ β–“β–“β–“β–“β–“β–“β–‘β–‘ β–“β–“β–“β–“
β–“β–“β–“β–“ β–‘β–‘β–‘β–‘β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–‘β–‘β–‘β–‘ β–“β–“β–“β–“
β–“β–“β–“β–“ β–‘β–‘β–‘β–‘β–‘β–‘β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–‘β–‘β–‘β–‘β–‘β–‘ β–“β–“β–“β–“
β–“β–“β–“β–“β–“β–‘β–‘β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–‘β–‘β–“β–“β–“β–“β–“
β–’β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–’
β–’β–’β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–’β–’
β–’β–’β–’β–’β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–’β–’β–’β–’
@inneroot
inneroot / arrayToBatchGenerator.js
Created March 10, 2022 06:47
split array to batches with generator
function* batchGenerator(array, batchSize) {
const arrCopy = [...array];
while(arrCopy.length>0){
yield arrCopy.splice(0, batchSize);
}
}
@inneroot
inneroot / forAwait.js
Created November 23, 2021 16:13
for await loop javascript
async function start() {
for await (let asyncFunction of asyncFunctions ) {
console.log(await asyncFunction())
}
}
start();
@inneroot
inneroot / forAwaitPromiseArr.js
Created June 16, 2020 13:37
Concurrent loop through array of Promises
callApi = [url1, url2, url3]
const pormiseArr = callApi.map(v => getFromApi(v))
const ConcurrentLoop = async() => {
for await (const resolvedPromise in pormiseArr) {
console.log(resolvedPromise)
}
}