Skip to content

Instantly share code, notes, and snippets.

@carrotIndustries
carrotIndustries / appsrc.cpp
Last active June 5, 2023 18:30
Really hacky application that renders shadertoy-compatible shaders and outputs an RTSP stream
//g++ appsrc.cpp $(pkg-config --libs --cflags gstreamer-1.0 osmesa gstreamer-rtsp-server-1.0) -o appsrc
// based on https://github.com/GStreamer/gst-rtsp-server/blob/master/examples/test-appsrc.c
// LICENSE: GPLv2
#include <gst/gst.h>
#include <gst/rtsp-server/rtsp-server.h>
//compile using g++ -std=c++17 main.cpp uuid.cpp -luuid -o utest -O3
#include "uuid.hpp"
#include <iostream>
using namespace horizon;
int main(void) {
UUID r;
diff --git schematic/sheet.cpp schematic/sheet.cpp
index 94b7c1a..f816d2d 100644
--- schematic/sheet.cpp
+++ schematic/sheet.cpp
@@ -67,7 +67,12 @@ namespace horizon {
const json &o = j["net_lines"];
for (auto it = o.cbegin(); it != o.cend(); ++it) {
auto u = UUID(it.key());
- net_lines.emplace(std::make_pair(u, LineNet(u, it.value(), this)));
+ try {
@carrotIndustries
carrotIndustries / srv.py
Created May 13, 2016 19:48
segfaults on win32
import socket
from gi.repository import GObject, GLib
#based on http://rox.sourceforge.net/desktop/node/413.html
def handler(conn, flags, sock):
'''Asynchronous connection handler. Processes each line from the socket.'''
line = sock.recv(4096)
if not len(line):
print("Connection closed.")
@carrotIndustries
carrotIndustries / et.c
Created January 4, 2016 17:12
EnergyTrace example
#include <stdio.h>
#include <unistd.h>
#include <stdbool.h>
#include <inttypes.h>
#include <assert.h>
#include <MSP430.h>
#include <MSP430_EnergyTrace.h>
#include <MSP430_Debug.h>
typedef struct __attribute__((packed)) {
@carrotIndustries
carrotIndustries / sine-fft.ipynb
Created September 16, 2015 19:47
ts interpolation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@carrotIndustries
carrotIndustries / decimation.ipynb
Created September 10, 2015 18:29
wav file decimation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.