Skip to content

Instantly share code, notes, and snippets.

View yshalsager's full-sized avatar

Youssif Shaaban Alsager yshalsager

View GitHub Profile
@yshalsager
yshalsager / README.md
Last active October 24, 2025 19:40
Quran Radio Stream Helper: a script wraps ffmpeg to pull a single Quran radio feed, add a live-updating title overlay, and restream it to multiple Telegram live-stream keys.

Quran Radio Stream Helper

This script wraps ffmpeg to pull a single Quran radio feed, add a live-updating title overlay, and restream it to multiple Telegram live-stream keys.

Dependencies

  • ffmpeg and ffprobe
  • writable runtime directory for the title file ($TITLE_FILE or default)
  • network access to the source radio feed and Telegram RTMPS endpoints
@yshalsager
yshalsager / delete_topic_messages.py
Last active October 15, 2025 18:08
A script to delete all messages in Telegram group topic using Telethon.
# requires-python = ">=3.13"
# dependencies = [
# "telethon",
# ]
# ///
import asyncio
from os import getenv
from telethon import TelegramClient
@yshalsager
yshalsager / al-badr-net-copy-download-links.js
Last active September 1, 2024 13:08
al-badr.net links CSV Extractor
@yshalsager
yshalsager / layout.txt
Created July 26, 2024 18:43
Heliboard custom Arabic 101 based layout
ض َ
ص ً
ث ُ
ق ٌ
ف لإ
غ إ
ع ‘
ه ÷
خ ×
ح ؛
// ==UserScript==
// @name alukah مخطوطات
// @namespace http://tampermonkey.net/
// @version 2024-06-01
// @description Extracts manuscript data and downloads a CSV fileز
// @author yshalsager
// @match https://www.alukah.net/library/11452/
// @icon https://www.google.com/s2/favicons?sz=64&domain=alukah.net
// @grant none
// ==/UserScript==
@yshalsager
yshalsager / calc_weight.py
Created April 4, 2024 03:53
Steps to create an Arabic dictionary for AOSP keyboard from shamela.ws
import sys
from pathlib import Path
import re
# Check if a file name is provided
if len(sys.argv) < 2:
print("Usage: python calc_weight.py <filename>")
sys.exit(1)
filename = Path(sys.argv[1])
@yshalsager
yshalsager / AnySoftKeyboard_to_HeliBoard.md
Last active March 31, 2024 21:31
Migrating AnySoftKeyboard user words history to HeliBoard

Migrating AnySoftKeyboard user words history to HeliBoard

  • Get a copy from AnySoftKeyboard user words (in app settings there's an option to open its location)
  • You need Python and Java JRE.
  • Run this python code, you can adjust file path to your xml correct one.
from xml.etree import ElementTree as etree
from pathlib import Path

<<Valentino Gagliardi - Decoupled Django_ Understand and Build Decoupled Django Architectures for JavaScript Front-ends-Apress (2021)>>Hypermedia All the Things 2024-02-16 11:45  |  Page No.: 21 As you can see, we say users, not user, when retrieving the resource. As a convention, resources should always be plural.

2024-02-16 11:47  |  Page No.: 22 some HTTP verbs are idempotent, meaning that the result of the operation is always stable.

2024-02-16 11:47  |  Page No.: 22 A POST request instead will always induce a side effect, that is, create a new resource

Cacheable 2024-02-16 11:57  |  Page No.: 24 A well-designed REST API should always give the client hints about the lifetime of a GET response. To do so, the backend sets a Cache-Control header on the response with a max-age directive,

2024-02-16 11:58  |  Page No.: 25 Cache-Control: max-age=3600

@yshalsager
yshalsager / albabtainlibrary_extract_books_urls.js
Created January 15, 2024 14:31
albabtainlibrary extract books urls
// ==UserScript==
// @name albabtainlibrary extract books urls
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Copy books pages URL from albabtainlibrary.
// @author yshalsager
// @match *://albabtainlibrary.org/zobair_list/
// @match *://albabtainlibrary.org/zobair_list/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=albabtainlibrary.org
// @run-at document-idle
# pip install httpx parsel
from pathlib import Path
from httpx import get
from parsel import Selector
books_urls = Path('books_list.txt').read_text().splitlines()
download_urls = Path('download_urls.txt')
if download_urls.exists():
download_urls.unlink()