``
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
prefix | province | city | |
---|---|---|---|
169 | آذربایجان شرقی | آذرشهر | |
170 | آذربایجان شرقی | اسکو | |
149 | آذربایجان شرقی | اهر | |
150 | آذربایجان شرقی | اهر | |
171 | آذربایجان شرقی | بستان آباد | |
168 | آذربایجان شرقی | بناب | |
136 | آذربایجان شرقی | تبریز | |
137 | آذربایجان شرقی | تبریز | |
138 | آذربایجان شرقی | تبریز |
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
from abc import ABC, abstractmethod | |
class CoOccurence(ABC): | |
def __init__(self) -> None: | |
self._container = None | |
@abstractmethod | |
def update(self, line: str) -> None: | |
... |
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
from __future__ import annotations | |
from itertools import product | |
from typing import Generator | |
OPERATORS: tuple[str, ...] = ("*", "+", "-", "/") | |
def iter_variables( | |
variables: dict[str, tuple[int]] |
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
"""Four-in-a-Row, by Al Sweigart al@inventwithpython.com A tile-dropping game to get four-in-a-row, similar to Connect Four.""" | |
import sys | |
from enum import Enum | |
from textwrap import dedent | |
class Cell(str, Enum): | |
EMPTY = "." | |
PLAYER_X = "X" | |
PLAYER_O = "O" |
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
# /etc/systemd/system/docker.service.d/proxy.conf | |
[Service] | |
Environment="HTTP_PROXY=socks5://127.0.0.1:12345" |
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
# My changes | |
# Change pane control to be Alt+vim arrow keys | |
bind-key -n M-h select-pane -L | |
bind-key -n M-l select-pane -R | |
bind-key -n M-k select-pane -U | |
bind-key -n M-j select-pane -D | |
# | |
# Change window control | |
bind-key l next-window | |
bind-key h previous-window |
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 os | |
from functools import wraps | |
def sudo_required(func): | |
"""Check sudo permission, if it hasn't, it'll exit non-zero.""" | |
@wraps(func) | |
def wrapper(*args, **kwargs): | |
if os.getuid() != 0: |
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 | |
import bs4 | |
import sys | |
URL_ROOT = "https://ets.sanjesh.org/Register.aspx" | |
SPECIFIC_TEXT = "موجودي ووچر به پايان رسيده است" | |
def get_data(url): | |
req = requests.get(url) |
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 tmp_copy(source, destination): | |
import shutil | |
import os | |
shutil.copy(source, destination) | |
try: | |
yield | |
finally: | |
os.remove(destination) |
NewerOlder