Skip to content

Instantly share code, notes, and snippets.

@rubenrua
rubenrua / KO_gst.parse_bin_from_description.py
Created February 27, 2013 10:33
Bug in GStreamer Python Bindings in gst.parse_bin_from_description
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
TO see the bug:
$cd /proc/`pgrep python`/fd; while true; do ls | wc -l; sleep 1; done
"""
import gst
import gtk
import gobject
@rubenrua
rubenrua / stress_simple.c
Created May 15, 2014 15:03
Bug in decklinksrc with releasing resources.
/*
gcc stress_simple.c `pkg-config --cflags --libs gstreamer-0.10 gtk+-2.0`
*/
#include <gst/gst.h>
#include <gtk/gtk.h>
typedef struct _CustomData {
GstElement *pipeline;
int s;
@rubenrua
rubenrua / README.md
Last active June 27, 2019 07:21
PHP e i18n de fechas

Hola chicos.

En la clase de hoy estudiaremos como funciona la internacionalización (i18n) de fechas en PHP.

La i18n de fechas en PHP recae sobre el sistema operativo. Se puede ver ejecutando:

# php -a
> setlocale(LC_ALL, 'es_ES.UTF8');
> var_dump(strftime("%d de %B de %Y", 1));
@rubenrua
rubenrua / lsh.rs
Last active February 21, 2021 20:23
// Write a Shell in Rust
// From Tutorial - Write a Shell in C: https://brennan.io/2015/01/16/write-a-shell-in-c/
// HN link: https://news.ycombinator.com/item?id=26126010
use std::env;
use std::io::{self, Write};
use std::process::Command;
fn lsh_cd(args: Vec<&str>) -> bool {
let home = env::var("HOME");