Skip to content

Instantly share code, notes, and snippets.

View sintezcs's full-sized avatar
🏠
Working from home

Alex Minakov sintezcs

🏠
Working from home
View GitHub Profile
@simonmesmith
simonmesmith / openai_streaming_with_functions.py
Last active June 11, 2025 12:50
Use OpenAI API streaming with functions
"""
This example shows how to use the streaming feature with functions.
"""
import json
import os
import sys
from collections.abc import Generator
from typing import Any, Dict, List
@artem78
artem78 / SymbianDev-en.md
Last active April 26, 2025 07:53
Developing for Symbian OS guide
@ancientGlider
ancientGlider / keenetic_auth.py
Last active March 24, 2025 17:07
Authentication for Keenetic routers for work with CLI via REST API (Python)
# -*- coding: utf-8 -*-
"""
Данные с адресом, логином, паролем хранятся в конфигурационном файле следующего вида:
[Router]
ip_addr = 192.168.1.1:8080
login = admin
passw = anyPassword
@tossmilestone
tossmilestone / Flake8.txt
Created March 30, 2018 06:55
Flake8 integrated with PyCharm
How to manually setup flake8 as PyCharm external tool
File / Settings / Tools / External Tools / Add
Name: Flake8
Program: $PyInterpreterDirectory$/python
Parameters: -m flake8 --max-complexity 10 --ignore E501 $FilePath$
Working directory: $ProjectFileDir$
Output Filters / Add
Name: Filter 1
@sintezcs
sintezcs / rate_limit.py
Last active February 16, 2017 07:41
Rate-limiting decorator
import threading
import time
def rate_limited(max_per_second):
lock = threading.Lock()
min_interval = 1.0 / max_per_second
def decorate(func):
last_time_called = time.perf_counter()