Skip to content

Instantly share code, notes, and snippets.

@fzakaria
fzakaria / double_array.go
Created January 21, 2016 18:39
How to iterate over a double array in Cgo
package avformat
//#cgo pkg-config: libavformat
//#include <libavformat/avformat.h>
import "C"
import (
"unsafe"
)
//https://www.ffmpeg.org/doxygen/2.7/structAVFormatContext.html
@camsaul
camsaul / hello_world.asm
Last active April 30, 2024 11:16
Hello World in NES (6502 / NESASM) Assembly. Display a single sprite
;;; -*- tab-width: 2 -*-
;;; These four lines go at the beginning of almost every code file. 16-byte iNES header
.inesprg 1 ; one bank of program code
.ineschr 1 ; one bank of picture data
.inesmap 0 ; we use mapper 0
.inesmir 1 ; Mirror setting always 1
;;; BANKING
@CMCDragonkai
CMCDragonkai / memory_layout.md
Last active May 9, 2024 14:12
Linux: Understanding the Memory Layout of Linux Executables

Understanding the Memory Layout of Linux Executables

Required tools for playing around with memory:

  • hexdump
  • objdump
  • readelf
  • xxd
  • gcore

This is a proposal for a lightning talk at the Reactive 2016 conference. If you like this, star the Gist.


Thinking metrics on React applications

In regular websites, it is common to send multiple events to track user clicks. Single Page Applications change the way you look at metrics. This is a talk about a simple pattern we created at Globo.com to manage a metrics layer for http://globoplay.globo.com. The talk will cover how to track user flow using Google Analytics and other services. We solved the challenge of tying metrics and components, keeping information across pages and having global data. Also some React, React Router and React Side Effects concepts like context, higher order components, history state will be covered.

##introduction

This benchmark evaluates the different presets options offered by x264, using medium as reference, and providing size and time differences (relative and not).

##benchmark Tests run with latest x264 (12139) and FFmpeg, configured to run with threading enabled. The slower and veryslow presets have been modified to keep the number of refs constant and compatible with most decoders. All results represent an average over 10 runs computed by perf.

Introduction

This table shows the current implementation status of several multimedia fomats by popular tools and browsers. All tests were run with the latest available version, or git HEAD for open source software.

Symbols mean

  • ✅ fully supported
  • ❗ unsupported
  • 💭 work in progress
  • 1️⃣️ see notes
% it creates a simple gray image (4x4)
I = [255, 255, 30, 100
255, 50, 90, 20
70, 70, 20, 10
100, 20, 10, 0];
% it converts it to grayscale
I = mat2gray(I);
% shows it
imshow(I);
function [ref_ii, ref_jj, blk_residual] = block_match(blk, frame)
% frame and block dimensions
[H, W] = size(frame);
blk_size = size(blk, 1);
ref_ii = 1;
ref_jj = 1;
err = (255 ^ 2) * (blk_size ^ 2);
blk_residual = 255 * ones(blk_size, blk_size);
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@GnaphronG
GnaphronG / cmaf.sh
Created May 28, 2018 23:57
HLS and DASH Manifest with CMAF files
#! /bin/sh
file="bbb_sunflower_2160p_30fps_normal.mp4"
timestamp=`date +%s`
ffmpeg="docker run --rm -it --workdir /tmp -v $PWD:/tmp kynothon/moviola:4.0-alpine "
bento4="docker run -it --rm -u $(id -u):$(id -g) -v $PWD:/tmp --workdir /tmp ggoussard/bento4docker "
echo "Getting the file"
curl -LO http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_2160p_30fps_normal.mp4