Skip to content

Instantly share code, notes, and snippets.

@Jim-Bar
Jim-Bar / YUV_formats.md
Last active April 26, 2024 03:28
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.

@phrawzty
phrawzty / 2serv.py
Last active April 26, 2024 03:28
simple python http server to dump request headers
#!/usr/bin/env python2
import SimpleHTTPServer
import SocketServer
import logging
PORT = 8000
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
@omnp
omnp / gtk-python-example4.py
Created August 3, 2023 19:04
Example showing how to create a minimal GTK 4 app with a main window and on it a Wayland subsurface fed by Vulkan.
# Example showing how to create a minimal GTK 4 app with a main window and on it a Wayland subsurface fed by Vulkan.
# The FPS counter printed on the console should show about 60 fps on Gnome/Mutter.
# One may need to install vulkan (the python package) from source.
# Maybe same for pywayland. Mileage may vary.
# I happen to have two discrete GPUs installed in the test computer, one AMD, one NVIDIA, and Intel integrated to top.
# The Radeon is the main one running Gnome/Mutter (after some /usr/share/glvnd/egl_vendor.d/ symlinking happened, that is)
# "Works for me" on the Radeon, when started from Gnome Terminal as python example4.py
# Playing around with switcherooctl style env variables trying to get the Nvidia card to render vulkan while being composited to
# the main window does not work though.
// Simple JavaScript Templating
// John Resig - http://ejohn.org/ - MIT Licensed
(function(){
var cache = {};
this.tmpl = function tmpl(str, data){
// Figure out if we're getting a template, or if we need to
// load the template - and be sure to cache the result.
var fn = !/\W/.test(str) ?
cache[str] = cache[str] ||
@Klerith
Klerith / pasos-node-typescript.md
Last active April 26, 2024 03:24
Configurar proyecto de Node con TypeScript

Pasos para usar Node con TypeScript con Nodemon

Más información - Docs Oficiales

  1. Instalar TypeScript y tipos de Node, como dependencia de desarrollo
npm i -D typescript @types/node
  1. Inicializar el archivo de configuración de TypeScript ( Se puede configurar al gusto)
@tatsumoto-ren
tatsumoto-ren / subs.md
Last active April 26, 2024 03:24
Japanese Subtitles

📓 Table of Contents 📚 Resources ✉️ Chat


kitsunekko.net jp subtitles

A large repository of japanese subtitles that is updated reasonably often and has a clean design.| The most popular one, you can upload your own subs.| Often have to be retimed.

@WebInspectInc
WebInspectInc / tasks-dashboard.js
Last active April 26, 2024 03:20
A small script for creating task completion graphs in Obsidian. See how to use this here: https://obsidian.rocks/plotting-task-completions-with-dataviewjs-and-obsidian-charts/
const dateformat = "YYYY-MM-DD";
const monthformat = "YYYY-MM";
const yearformat = "YYYY";
const days = parseInt(dv.current().days);
const months = parseInt(dv.current().months);
const years = parseInt(dv.current().years);
const projectFolder = dv.current().projectfolder || '';
const graphColor = dv.current().lineColor || '#de454e';
const charts = [];
@holly
holly / nc-tcp-forward.sh
Created October 17, 2015 02:32
easy tcp port forwarding by netcat
#!/usr/bin/env bash
set -e
if [ $# != 3 ]; then
echo 'Usage: nc-tcp-forward.sh $FRONTPORT $BACKHOST $BACKPORT' >&2
exit 1
fi
@voluntas
voluntas / h2c.go
Created August 22, 2023 00:55
HTTP/2 over TCP
package main
import (
"net/http"
"github.com/labstack/echo/v4"
"golang.org/x/net/http2"
"golang.org/x/net/http2/h2c"
)
@fsworld009
fsworld009 / 1 steam_deck_notes.md
Last active April 26, 2024 03:14
Steam deck setup notes.md

Disk encryption

None. ValveSoftware/SteamOS#771 Be careful on what you are storing in this device (using browser and login to your accounts is NOT a good idea for now).

Barrier

Being able to control Steamdeck by using mouse and keyboard connected to PC/Laptop