This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def gcd(x, y): # Simplify Fraction (Greatest common divisor) | |
if (x < y): | |
temp = x | |
x = y | |
y = temp | |
while (y != 0): | |
remainder = x % y | |
x = y | |
y = remainder | |
r = x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import arabic_reshaper # pip install arabic-reshaper | |
from bidi.algorithm import get_display # pip install python-bidi | |
from PIL import ImageFont, Image, ImageDraw # pip install Pillow | |
def wrap(text, maxLen): | |
res_lines = [] | |
for line in text.split('\n'): | |
lines = [] | |
words = line.split(' ') | |
line = '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am erfanhs on github. | |
* I am erfoon (https://keybase.io/erfoon) on keybase. | |
* I have a public key ASA_MoCunSQ8x8Ph-sIFK9cInnNc77Vf76nv88XEoR4vcwo | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
from pathlib import Path | |
# github.com/erfanhs | |
# download with twittervideodownloader.com | |
class Downloader: | |
def __init__(self, output_dir='./output/'): |