Skip to content

Instantly share code, notes, and snippets.

View vincentsarago's full-sized avatar

Vincent Sarago vincentsarago

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Important

DO NOT USE VSCODE terminal and make sure uname -m returns arm64

  1. First Install Xcode command line tool
xcode-select --install
  1. Create and change /opt directories owner
from rio_tiler.io import COGReader
with COGReader("my-tif.tif") as cog:
# get info
info = cog.info()
# get image statistics
stats = cog.stats()
# get metadata (info + image statistics)
"""Cache Plugin."""
import urllib
from typing import Optional
import aiocache
from starlette.responses import Response
from fastapi.dependencies.utils import is_coroutine_callable
@vincentsarago
vincentsarago / des.py
Created December 17, 2020 08:28
security example
"""app dependencies."""
import re
from dataclasses import dataclass
from jose import JWTError
from fastapi import HTTPException, Query, Security
from fastapi.security.api_key import APIKeyQuery
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2020-10-21T10:40:34.347-04:00 START RequestId: 6e4294bf-5920-49df-982c-9b3c8b4268fd Version: $LATEST
2020-10-21T10:40:34.366-04:00 [INFO] 2020-10-21T14:40:34.366Z 6e4294bf-5920-49df-982c-9b3c8b4268fd IMDS ENDPOINT: http://169.254.169.254/
2020-10-21T10:40:34.428-04:00 [INFO] 2020-10-21T14:40:34.427Z 6e4294bf-5920-49df-982c-9b3c8b4268fd IMDS ENDPOINT: http://169.254.169.254/
2020-10-21T10:40:34.508-04:00 [INFO] 2020-10-21T14:40:34.508Z 6e4294bf-5920-49df-982c-9b3c8b4268fd IMDS ENDPOINT: http://169.254.169.254/
2020-10-21T10:40:34.523-04:00 [INFO] 2020-10-21T14:40:34.523Z 6e4294bf-5920-49df-982c-9b3c8b4268fd IMDS ENDPOINT: http://169.254.169.254/
2020-10-21T10:40:34.540-04:00 [INFO] 2020-10-21T14:40:34.539Z 6e4294bf-5920-49df-982c-9b3c8b4268fd IMDS ENDPOINT: http://169.254.169.254/
2020-10-21T10:40:34.554-04:00 [INFO] 2020-10-21T14:40:34.554Z 6e4294bf-5920-49df-982c-9b3c8b4268fd IMDS ENDPOINT: http://169.254.169.254/
2020-10-21T10:40:34.568-04:00 [INFO] 2020-10-21T14:40:34.568Z 6e4294bf-5920-49df-982c-9b3c8b426
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import sys
import zlib
import json
from concurrent import futures
from urllib.parse import urlparse
import boto3
import click