Skip to content

Instantly share code, notes, and snippets.

@tombulled
tombulled / app.py
Created November 15, 2020 20:37
Stream a file, in this case an mp4 video, supporting range-requests using starlette
from starlette.applications import Starlette
from starlette.responses import StreamingResponse
from starlette.requests import Request
from starlette.routing import Route
from pathlib import Path
from typing import IO, Generator
"""
Stream a file, in this case an mp4 video, supporting range-requests using starlette
@yinzara
yinzara / github_bitbucket_multiple_ssh_keys.md
Last active May 22, 2024 17:33
Managing SSH keys and repo cloning using multiple accounts on GitHub and BitBucket

Why Multiple SSH keys?

There are numerous reasons you may need to use multiple SSH keys for accessing GitHub and BitBucket

You may use the same computer for work and personal development and need to separate your work.

When acting as a consultant, it is common to have multiple GitHub and/or BitBucket accounts depending on which client you may be working for.

You may have different projects you're working on where you would like to segregate your access.

@pmarreck
pmarreck / convert_png_to_mp4.bash
Last active June 19, 2019 15:02
FFmpeg command to convert a png to a single-frame mp4 (with pretty stellar compression, especially compared to jpeg) BONUS: Full browser support!
# On OS X, with an ffmpeg installed via Homebrew, the following command works and results in a single-frame movie file that is compatible with Chrome, QuickTime and the latest iDevices:
ffmpeg -i FILENAME.png -an -vcodec libx264 -coder 1 -flags +loop -cmp +chroma -subq 10 -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -profile:v high -level 4.2 -pix_fmt yuv420p -vf “scale=trunc(iw/2)*2:trunc(ih/2)*2” -trellis 2 -partitions +parti8x8+parti4x4 -crf 24 -threads 0 -r 25 -g 25 -y FILENAME.mp4
package main
import (
"net/http"
"database/sql"
"fmt"
"log"
"os"
)