Skip to content

Instantly share code, notes, and snippets.

View sphaero's full-sized avatar

Arnaud Loonstra sphaero

View GitHub Profile
@sphaero
sphaero / main.cpp
Created March 20, 2024 14:13
SDL OpenGL Dear ImGui Example with libuv integration
// Dear ImGui: SDL2 + OpenGL + libuv
#include "imgui/imgui.h"
#include "imgui/backends/imgui_impl_sdl2.h"
#include "imgui/backends/imgui_impl_opengl3.h"
#include <stdio.h>
#include <uv.h>
#include <SDL.h>
#if defined(IMGUI_IMPL_OPENGL_ES2)
#include <SDL_opengles2.h>
@sphaero
sphaero / rokoko-decode.py
Created October 18, 2018 14:10
Test to decode rokoko UDP data and send it through OSC
# author: A.J. Loonstra <arnaud@sphaero.org>
# Test to decode rokoko UDP data
#
import struct
import socket
from collections import namedtuple
import liblo
import time
UDP_IP = "0.0.0.0"
@sphaero
sphaero / rpi_sender.py
Created June 20, 2019 20:03
ZOCP PiCam controller and sender
# PiCam h264 RTP Sender controllable by ZOCP
# Copyright (C) 2015 Arnaud Loonstra
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@sphaero
sphaero / gstseamlessloop.py
Last active December 23, 2023 09:50
Gstreamer seamless loop test
#/usr/bin/env python3
#
# Seamless loop test
# Copyright (c) 2015 Arnaud Loonstra <arnaud@sphaero.org>
#
# This is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@sphaero
sphaero / winipaddr.py
Last active April 10, 2023 00:12
Get windows ipadresses info
#!/usr/bin/env python
#
# For the sake of humanity here's a python script retrieving
# ip information of the network interfaces.
#
# Pay some tribute to my soul cause I lost a few years on this one
#
# based on code from jaraco and many other attempts
# on internet.
# Fixed by <@gpotter2> from scapy's implementation to
@sphaero
sphaero / gstreamer-build.sh
Last active February 11, 2023 16:25
Install & build gstreamer from git
#!/bin/bash --debugger
set -e
BRANCH="master"
if grep -q BCM2708 /proc/cpuinfo; then
echo "RPI BUILD!"
RPI="1"
fi
[ -n "$1" ] && BRANCH=$1
/*
ESPTest for ZMTP + ZRE + ZOCP
Original author: Ronald Hof <ronald@k-n-p.org>
license: MPLv2
*/
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
#include <string.h>
@sphaero
sphaero / timelapse.py
Created February 11, 2022 14:15
RPI timelapser
#!/usr/bin/python3
from time import sleep
from picamera import PiCamera
camera = PiCamera()
camera.resolution = (1920, 1080)
#camera.start_preview()
# Camera warm-up time
sleep(5)
count = 0
@sphaero
sphaero / gurumed.c
Created April 13, 2021 19:30
Guru meditation example using ansi coding
#include <stdio.h>
#include <wchar.h>
#include <locale.h>
wchar_t tl=0x250f;
wchar_t tr=0x2513;
wchar_t bl=0x2517;
wchar_t br=0x251b;
wchar_t vs=0x2503;
//wchar_t hs[23]={0x2501,0x2501,0x2501,0x2501,0x2501,0x2501,0x2501,0x2501,0x2501,0x2501,0x2501,0x2501,0x2501,0x2501,0x2501,0x2501,0x2501,0x2501,0x2501,0x2501,0x0};
@sphaero
sphaero / Nodes.cpp
Created December 12, 2018 15:07 — forked from ChemistAion/nodes.cpp
Second prototype of standalone node graph editor for ImGui
#include "Nodes.h"
namespace ImGui
{
template<int n>
struct BezierWeights
{
constexpr BezierWeights() : x_(), y_(), z_(), w_()
{
for (int i = 1; i <= n; ++i)