Skip to content

Instantly share code, notes, and snippets.

View INF800's full-sized avatar
🍁
For truth we seek infinite and beyond.

Asapanna Rakesh INF800

🍁
For truth we seek infinite and beyond.
View GitHub Profile
@INF800
INF800 / __init__.py
Last active November 15, 2021 23:44
FASTAPI Boilerplate
# empty
@timhughes
timhughes / fastapi_websocket_redis_pubsub.py
Last active April 29, 2024 08:00
FastAPI Websocket Bidirectional Redis PubSub
"""
Usage:
Make sure that redis is running on localhost (or adjust the url)
Install uvicorn or some other asgi server https://asgi.readthedocs.io/en/latest/implementations.html
pip install -u uvicorn
Install dependencies
@blaylockbk
blaylockbk / multipro_template.py
Last active May 20, 2024 16:39
Template for Python multiprocessing and multithreading
import multiprocessing
from multiprocessing.dummy import Pool as ThreadPool
import numpy as np
def my_multipro(items, func, max_cpus=12):
"""Do an embarrassingly parallel task using multiprocessing.
Use this for CPU bound tasks.
@martinsik
martinsik / circle_detection.py
Last active April 22, 2023 09:50
Circle detection with OpenCV 3.0
import cv2
import time
import math
import numpy as np
capture = cv2.VideoCapture(0)
print capture.get(cv2.CAP_PROP_FPS)
t = 100
w = 640.0