Skip to content

Instantly share code, notes, and snippets.

View ricekab's full-sized avatar

Kevin Chi Yan Tang ricekab

  • Pixel-Nexus
  • 06:33 (UTC +02:00)
View GitHub Profile
@ricekab
ricekab / ffmpeg_example.txt
Last active July 17, 2023 10:22
ffmpeg overlay + drawtext simple examples
1. Add overlay over entire video. No extra text
ffmpeg -i examplecut.mp4 -i overlay.png -filter_complex "[0:v][1:v] overlay" -c:a copy output.mp4
2. Add overlay over for 10 seconds in the middle (5s - 15s in this example)
ffmpeg -i examplecut.mp4 -i overlay.png -filter_complex "[0:v][1:v] overlay=enable='between(t,5,15)'" -c:a copy output2.mp4
2b. Add overlay starting from X time until the end (X=5 in this example)
@ricekab
ricekab / app.py
Created October 23, 2022 13:55
A small Python Flask server to perform HMAC verification.
"""
This is for development purposes only! Uses the werkzeug WSGI server that Flask ships with.
"""
import hmac
import logging
import hashlib
from flask import Flask, request
# Just tagging onto the dev server logger
@ricekab
ricekab / Vagrantfile
Created June 24, 2021 15:54
Vagrant - postgresql 11 box based on Debian 10 (buster64)
# -*- mode: ruby -*-
# vi: set ft=ruby :
### HOW TO USE
# Forwards host port 5432 (change if necessary)
# Creates a user "vagrant" with password "vagrant" and database called "vagrant".
# "vagrant" user is a superuser.
#
# Example connection string: "postgresql://vagrant:vagrant@localhost:5432/vagrant"
#
@ricekab
ricekab / Vagrantfile
Created February 22, 2021 12:37
Postgres 11 Vagrantfile (centos7 base) - for development only
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
config.vm.box = "centos/7"
@ricekab
ricekab / FASTBuild.cs
Created December 10, 2018 16:22
FASTBuild for UE 4.21
// Copyright 2018 Yassine Riahi and Liam Flookes. Provided under a MIT License, see license file on github.
// Used to generate a fastbuild .bff file from UnrealBuildTool to allow caching and distributed builds.
// Tested with Windows 10, Visual Studio 2015/2017, Unreal Engine 4.19.1, FastBuild v0.95
// Durango is fully supported (Compiles with VS2015).
// Orbis will likely require some changes.
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Diagnostics;
@ricekab
ricekab / example.py
Created December 2, 2018 22:33
Python logging clarification
import logging
logger_one = logging.getLogger('example')
logger_two = logging.getLogger('example')
assert logger_one is logger_two # True because they are the same instance