Skip to content

Instantly share code, notes, and snippets.

@mildsunrise
mildsunrise / mp4parser.py
Last active March 13, 2024 23:17
🕵️‍♀️ MP4 parser / dissector for the command line
#!/usr/bin/env python3
'''
Code by Alba Mendez, manually copied and pasted, had 8 revisions when copied.
https://gist.github.com/mildsunrise/ffd74730504e4dc44f47fc7528e7bf59
Portable* ISO Base Media File Format dissector / parser.
Usage: ./mp4parser.py <file name>
(*) Needs Python 3.8+
@Jim-Bar
Jim-Bar / YUV_formats.md
Last active March 2, 2024 09:41
About YUV formats

About YUV formats

First of all: YUV pixel formats and Recommended 8-Bit YUV Formats for Video Rendering. Chromium's source code contains good documentation about those formats too: chromium/src/media/base/video_types.h and chromium/src/media/base/video_frame.cc (search for RequiresEvenSizeAllocation(), NumPlanes() and those kinds of functions).

YUV?

You can think of an image as a superposition of several planes (or layers in a more natural language). YUV formats have three planes: Y, U, and V.

Y is the luma plane, and can be seen as the image as grayscale. U and V are reffered to as the chroma planes, which are basically the colours. All the YUV formats have these three planes, and differ by the different orderings of them.

@martinarroyo
martinarroyo / citationneeded.tex
Created June 1, 2015 22:10
A LaTeX macro that sets a Wikipedia-stylized "Citation Needed" template and outputs the counter of references with a surprise. Use with write18 enabled! and the Figures directory in \graphicspath{}!
\newcounter{undefinedreferences}
\setcounter{undefinedreferences}{0}
\newcommand{\citationneeded}[1][None]{\stepcounter{undefinedreferences}\textsuperscript{\color{blue} [Citation needed: #1]}}
\newcommand{\checkreferences}{
\ifnum\value{undefinedreferences} > 0
\begin{center}
\immediate\write18{wget -O Figures/protester.png -nc http://imgs.xkcd.com/comics/wikipedian_protester.png}
\includegraphics[width=\textwidth]{protester.png}
diff --git a/bar.c b/bar.c
index 68b41ca..b9f2ae5 100644
--- a/bar.c
+++ b/bar.c
@@ -1,5 +1,6 @@
// vim:sw=4:ts=4:et:
#include <stdbool.h>
+#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
@ctalkington
ctalkington / grunt.js
Created September 12, 2012 02:44
Grunt Glob to Multi Files Object
// gruntfile dropin used to build a grunt files object with 1:1 structure
function globToMultiFiles(glob, dest, options) {
var path = require('path');
grunt.util = grunt.util || grunt.utils;
dest = grunt.template.process(dest);
options = grunt.util._.defaults(options || {}, {
cwd: '',