Skip to content

Instantly share code, notes, and snippets.

View abrman's full-sized avatar
🚀

Matthew Abrman abrman

🚀
  • Trenčín, Slovakia
View GitHub Profile
@abrman
abrman / Svelte_tutorial.md
Last active December 23, 2021 15:36
Svelte tutorial notes - cheatsheet

If-else

{#if x > 10}
	{x} is too large!
{:else if 5 > x}
	{x} is perfect
{:else}
@abrman
abrman / ffmpeg_burn_subs.command
Created June 20, 2021 19:49
ffmpeg add srt to video file with solid black subtitle background
# Adds subtitles.srt to video.mp4 as solid black background, and saves as subbed_video.mp4
# via: https://stackoverflow.com/questions/25870169/how-to-set-background-to-subtitle-in-ffmpeg
# Options:
# OutlineContour=&AARRGGBB - [Alpha, Red, Green, Blue], Change Alpha value for semi-transparent background
# Outline=3 - Specifies the padding for the background rectangle.
ffmpeg -i video.mp4 -filter_complex "subtitles=subtitles.srt:force_style='OutlineColour=&000000000,BorderStyle=3,Outline=3,Shadow=0,MarginV=20'" subbed_video.mp4
@abrman
abrman / hex_color_mix.php
Last active March 3, 2019 13:43
Simple hex color mixer in PHP
<?php
function lerp($min, $max, $value) { return $min*(1-$value)+$max*$value; }
function mixColors($colorA, $colorB, $factor){
// Assign R, G and B values for each color
list($aR, $aG, $aB) = sscanf($colorA, "#%02x%02x%02x");
list($bR, $bG, $bB) = sscanf($colorB, "#%02x%02x%02x");
// put the colors back together in hex color format with the mixed value
return sprintf("#%02x%02x%02x",