Skip to content

Instantly share code, notes, and snippets.

@nikolaysm
nikolaysm / gist:1f8e6dd42173a62341d34d616151888e
Created March 21, 2021 16:02 — forked from bradleyayers/gist:1480017
Fill a page with an image with ReportLab and PIL
def fill_page_with_image(path, canvas):
"""
Given the path to an image and a reportlab canvas, fill the current page
with the image.
This function takes into consideration EXIF orientation information (making
it compatible with photos taken from iOS devices).
This function makes use of ``canvas.setPageRotation()`` and
``canvas.setPageSize()`` which will affect subsequent pages, so be sure to
# pull official python alpine image
FROM python:3.7-alpine
# Set Environment Variable
ENV PYTHONUNBUFFERED 1
ENV C_FORCE_ROOT true
# Making source and static directory
RUN mkdir /src
RUN mkdir /static
@nikolaysm
nikolaysm / rest-api-response-format.md
Created April 11, 2025 12:51 — forked from igorjs/rest-api-response-format.md
REST API response format based on some of the best practices
@nikolaysm
nikolaysm / curl.md
Created September 22, 2025 09:33 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.