Skip to content

Instantly share code, notes, and snippets.

View Vicfred's full-sized avatar
:octocat:
I like mathemagic and computering

Vicfred Vicfred

:octocat:
I like mathemagic and computering
View GitHub Profile
@Vicfred
Vicfred / batch_add_bars_resize.sh
Created March 13, 2024 04:58
portrait resize to 4:5 add bars
#!/bin/bash
for image_file in *.jpg; do
width=$(identify -format '%w' "$image_file")
height=$(identify -format '%h' "$image_file")
width_difference=$((height * 4/5 - width))
bar_size=$((width_difference/2))
echo "adding bar of size" $bar_size
convert $image_file -bordercolor black -border $((bar_size))x0 -quality 100 $image_file
echo "resizing from" $width "x" $height "to 1080x1350"
convert $image_file -resize 1080x1350 -quality 95 $image_file
@Vicfred
Vicfred / conventions.md
Last active January 21, 2024 09:49
Conventions

Anime

US

Convention Place
Anime Expo Los Angeles, California
Otakon Washington DC
Anime Central Chicago, Illinois
Anime Boston Boston, Massachusetts
Sakura Con Seattle, Washington
Anime Matsuri Houston, Texas
@Vicfred
Vicfred / ffmpeg.md
Last active April 12, 2024 06:12
ffmpeg common

metadata

ffprobe input.mp4

(no export)

INPUT_VIDEO=input.mp4
@Vicfred
Vicfred / pengvado.txt
Created October 7, 2023 05:18
pengvado quotes
(Shamelessly copied from the similar Michael Niedermayer page)
How can one explain the phenomenon that is Loren Merritt? Perhaps he is a superintelligent alien sent to observe us, who hacks on x264 and ffmpeg for amusement. It's also possible he's either a cybernetically enhanced human, or a wildly successful AI project. Either way, there must be great wisdom contained in his writing. Perhaps most of this is contained in code. But for laypeople, studying some of his quotes might provide some benefits.
I have tried to identify the most prototypical Loren quotes. A large fraction of his messages fall into one of the formats below. A few of the posts highlighted below are special and don't belong into any large category.
Here are a few top ranking candidates. IT IS VERY IMPERATIVE THAT YOU READ EACH AND EVERY LETTER OF EACH AND EVERY ONE.
Loren Merritt...
On Algorithms
On Broadcast and Media
@Vicfred
Vicfred / n2bumpoyukasensei.txt
Last active September 15, 2023 17:05
n2bumpoyukasensei
=====だから=====
~だけあって A45
~からには/以上は I195
~からして A199
=====なのに=====
~にもかかわらず I257
~にしては A697
~わりに A697
~といっても I474
@Vicfred
Vicfred / normcore-llm.md
Created September 7, 2023 05:29 — forked from veekaybee/normcore-llm.md
Normcore LLM Reads
@Vicfred
Vicfred / coupon.cpp
Created August 9, 2023 05:46
Coupon collector problem
// https://math.stackexchange.com/questions/28905/expected-time-to-roll-all-1-through-6-on-a-die
// https://en.wikipedia.org/wiki/Coupon_collector%27s_problem
#include <iostream>
#include <random>
#include <set>
using namespace std;
int main() {
long double expected = 0.0L;
@Vicfred
Vicfred / events.md
Created July 30, 2023 06:11
events
@Vicfred
Vicfred / zig.md
Last active June 26, 2023 02:39
zig tricks

read int

const std = @import("std");

pub fn main() !void {
    const stdout = std.io.getStdOut();
    const reader = std.io.getStdIn().reader();

    var buffer: [1024]u8 = undefined;
 while (try reader.readUntilDelimiterOrEof(&amp;buffer, '\n')) |line| {