Skip to content

Instantly share code, notes, and snippets.

View fernandoherreradelasheras's full-sized avatar

Fernando Herrera fernandoherreradelasheras

View GitHub Profile
@fernandoherreradelasheras
fernandoherreradelasheras / Eurotrack_MiddleEast_Oct24.json
Created May 18, 2025 12:42
Eurotrack MiddleEast poll from Oct24 in json format
{
"survey_info": {
"title": "YouGov / Eurotrack Survey Results",
"sample_size": {
"GB": 2098,
"France": 1014,
"Germany": 2077,
"Denmark": 1019,
"Sweden": 1007,
"Spain": 1072,
@fernandoherreradelasheras
fernandoherreradelasheras / eurovision_2025_votes.json
Created May 18, 2025 12:41
Eurovision song contest 2025 jury votes + sms votes per emitting country
{
"Albania": {
"jury_points_given": {
"France": 12,
"Spain": 10,
"Switzerland": 8,
"Austria": 7,
"Greece": 6,
"Israel": 5,
"Sweden": 4,
#include <SDL2/SDL.h>
#include <unistd.h>
#include <stdio.h>
/* Compile with:
* g++ -g -o sdl2_wayland_libdecor_bug sdl2_wayland_libdecor_bug.cpp `sdl2-config --cflags --libs`
*/
const int disp_w = 400, disp_h = 300;
static SDL_Window *window = NULL;
@fernandoherreradelasheras
fernandoherreradelasheras / smart-video-cutter.sh
Created February 26, 2022 17:01
Smart video cutter with minimal transcoding using ffmpg
#!/usr/bin/bash
#
# Cut a fragment of a video with the minimal possible re-encoding.
# If the new start point is not a key frame it reencodes the video
# from that point until the frame before a new keyframe. The remaining
# part is copied as passthrough and both fragments are concatenated
#
# In order to make the video streams compatible we use the same codec
# and bitrate. This works fine with h264. No idea about other codecs
@fernandoherreradelasheras
fernandoherreradelasheras / mpv-freedesktop-screensaver-plugin.c
Created April 12, 2021 11:25
mpv pluging to inhibit screensaver while playing a video using freedesktop dbus api
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <gio/gio.h>
#include <mpv/client.h>
/**
* mpv pluging to inhibit screensaver while playing a video on GNOME Desktop