Skip to content

Instantly share code, notes, and snippets.

View roman-ku's full-sized avatar

Roman Kuleshov roman-ku

View GitHub Profile
@roman-ku
roman-ku / flask_unveil_server.py
Created January 1, 2019 01:56 — forked from peterkuma/server.py
A flask server for serving all JPEG images in a local directory and subdirectories. Uses unveil.js for lazy-loading of images. Thumbnails are created on the fly by PIL.
# you also need to download this file: https://github.com/luis-almeida/unveil/blob/master/jquery.unveil.js
# and place it in the same directory as this python file with the name "jquery.unveil.js"
import os
from io import BytesIO
from flask import Flask, Response, request, abort, render_template_string, send_from_directory
from PIL import Image
import datetime
from pprint import pprint as pp
from trello import TrelloClient
client = TrelloClient(
api_key='your-key',
api_secret='your-secret',
token='your-oauth-token-key',