Skip to content

Instantly share code, notes, and snippets.

View handledexception's full-sized avatar

Paul Hindt handledexception

  • Nevada City, Ca
View GitHub Profile
@handledexception
handledexception / enable_shared_from_this.cpp
Last active September 9, 2019 23:18
enable_shared_from_this example
#include <iostream>
#include <memory>
#define DECLARE_SHARED(klass) \
class klass; \
using klass##Ptr = std::shared_ptr<klass>; \
using klass##WPtr = std::weak_ptr<klass>; \
DECLARE_SHARED(Shared);
class Shared : public std::enable_shared_from_this<Shared> {
@handledexception
handledexception / ffmpeg-cheat.md
Created September 9, 2019 23:16
FFMPEG Cheat Sheet

FFMPEG Cheat Sheet

Remux Video/Audio

Copy all input streams to output

ffmpeg -i input.ts -c:v copy -c:a copy -map 0:? output.mkv

Video Scaling

@handledexception
handledexception / ubuntu-clang8.md
Created September 9, 2019 23:13
Ubuntu Install Clang 8
sudo apt-add-repository deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-8 main
apt-get install clang-8 lldb-8 lld-8
@handledexception
handledexception / psql-quickstart.md
Created September 9, 2019 23:11
PostgreSQL Quickstart

CentOS7

Install

$ sudo yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
$ sudo yum install postgresql11
$ sudo yum install postgresql11-server

Initialization

docker login gitlab.com:1234/myregistry
docker run --name mycontainer --rm --cpus=4 -v /Users/paulh/Docker/Share:/MountedFS -p 50051:50051 -d gitlab.com:1234/myregistry/mycontainer:latest
docker exec -it mycontainer bash
docker logs -f mycontainer
@handledexception
handledexception / ffmpeg-tc-burn.txt
Last active February 15, 2019 18:49
FFMPEG Timecode Burn-in
./Downloads/ffmpeg/ffmpeg -i ~/Movies/Nausicaa.mkv \
-vf "drawtext=fontfile=ProFontWindows.ttf: timecode='00\:00\:00\:00': r=23.976: x=(w-tw)/2: y=h-(2*lh): \
fontcolor=white: fontsize=48: box=1: boxcolor=0x00000099" -s 1920x1080 -c:v prores_ks -c:a pcm_s16le -map 0:0 -map 0:4 \
~/Movies/nausicaa_test.mov