Skip to content

Instantly share code, notes, and snippets.

@roger-
roger- / array.py
Created December 3, 2012 03:49
1D array library test (for Pythonista)
from __future__ import division
import numbers
import operator
import math
class array(list):
def __getitem__(self, y):
if isinstance(y, (numbers.Integral, slice)):
return list.__getitem__(self, y)
@roger-
roger- / main.cpp
Last active August 10, 2017 22:41
Part of RTSP server
/* ---------------------------------------------------------------------------
** This software is in the public domain, furnished "as is", without technical
** support, and with no warranty, express or implied, as to its usefulness for
** any purpose.
**
** main.cpp
**
** V4L2 RTSP streamer
**
** H264 capture using middleware_video
@roger-
roger- / v4lenc.c
Last active November 4, 2017 20:32
/*
* Copyright (c) 2013 Clément Bœsch
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
@roger-
roger- / mqtt_redirector.py
Created December 24, 2020 20:04
Redirect messages from one MQTT server to another
import sys
import time
import re
import paho.mqtt.client as mqtt
regex_address = re.compile(r'(?:(?P<username>.+):(?P<password>.+)@)?(?P<address>[\w.]+)(?::(?P<port>[0-9]+))?')
def on_message(client_src, userdata, message):
client_dest, topic_root = userdata