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 urllib.request import urlopen | |
import json | |
import toml | |
BASE_URL = "https://api.github.com/repos/python/cpython/pulls?per_page=1000&state=all" | |
def main(): | |
page = 1 | |
all_issues = [] | |
while page <= 10: | |
with urlopen(f"{BASE_URL}&page={page}") as response: |
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 threading | |
from playwright.sync_api import sync_playwright | |
from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor | |
class Tls(threading.local): | |
def __init__(self) -> None: | |
self.playwright = sync_playwright().start() | |
print("Create playwright instance in Thread", threading.current_thread().name) |
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 asyncio | |
from threading import Thread, enumerate | |
def async_to_sync() -> asyncio.AbstractEventLoop: | |
loop = asyncio.new_event_loop() | |
Thread(target=loop.run_forever).start() | |
return loop |
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
/* | |
ESP8266 LPG Leakage Email Sender | |
Monitors the LPG sensor output 500 times and takes the average of the sampling to reduce reading noise, | |
and if the value is greater than the threshold value, it sends email to the recipient . | |
Before uploading make sure that your ESP8266 Core is version is 2.4.0 as this code only works for that ! | |
Before uploading the code make to sure to change in the Gsender header file: | |
const int SMTP_PORT = 465;// STMP port change it if you use other smtp |