Skip to content

Instantly share code, notes, and snippets.

@Hermann-SW2
Hermann-SW2 / pipn.c
Created September 14, 2021 10:14
C script for piping input onto n pipes for further processing
#!/bin/bash
exc=/tmp/pipn.c
if [ $0 -nt $exc ]; then sed -n "/^\/\*\*$/,\$p" $0 | gcc -x c - -o $exc; fi
cat | $exc "$@"
exit
/**
*/
#include <stdio.h>
@Hermann-SW2
Hermann-SW2 / headtail.c
Last active September 14, 2021 10:14
C script demo application, demoing pipeing input onto two pipes
#!/bin/bash
exc=/tmp/headtail.c
if [ $0 -nt $exc ]; then sed -n "/^\/\*\*$/,\$p" $0 | gcc -x c - -o $exc; fi
cat | $exc
exit
/**
*/
#include <stdio.h>
@Hermann-SW2
Hermann-SW2 / dispmanx.c
Created September 10, 2021 19:21
moving overlay with 60° roach on top
/*
Copyright (c) 2012, Broadcom Europe Ltd
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
@Hermann-SW2
Hermann-SW2 / dispmanx.c
Last active October 24, 2023 02:44
Raspberry hello_pi dispmanx.c extended with DrawCircle() for crosshairs demo
/*
Copyright (c) 2012, Broadcom Europe Ltd
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the