Skip to content

Instantly share code, notes, and snippets.

View DarkSuniuM's full-sized avatar

Alireza Ayinmehr DarkSuniuM

View GitHub Profile
@DarkSuniuM
DarkSuniuM / nginx.conf
Created March 12, 2020 21:57 — forked from ubermuda/nginx.conf
Proxy a unix socket HTTP server to a tcp port using nginx.
server {
listen 127.0.0.1:9000;
location / {
proxy_pass http://unix:/var/run/docker.sock:/;
}
}
@DarkSuniuM
DarkSuniuM / Flask-Restful_S3_File_Upload.py
Last active November 5, 2018 04:03 — forked from RishabhVerma/Flask-Restful_S3_File_Upload.py
Uploading a file to S3 while using Flask with Flask-Restful to create a REST API. [ Python 3 ]
# -*- coding: utf-8 -*-
"""
An example flask application showing how to upload a file to S3
while creating a REST API using Flask-Restful.
Note: This method of uploading files is fine for smaller file sizes,
but uploads should be queued using something like celery for
larger ones.
"""
from io import BytesIO