Skip to content

Instantly share code, notes, and snippets.

@twonoise
twonoise / jack_glbars.c
Last active June 11, 2025 13:21
Quick n Dirty JACK's glBars transparency
// jpka, 2025: Q&D example to make glBars transparent,
// this is impossible with glut. And make it pure C.
// Note, there will be no MSAA using integrated GPU.
// The fun fact is all colors were already made correctly
// using alpha, as if it was already transparent years ago.
// Tested w/ Archlinux.
// gcc -g -Wall -lm -lX11 -lXrender -lGL -ljack -DHAS_GL jack_glbars.c -o jack_glbars
/* XMMS - Cross-platform multimedia player
* Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies
@endolith
endolith / WAV interpretation.md
Last active November 3, 2026 18:28
Interpretation of WAV file sample data and asymmetry

How to handle asymmetry of WAV data?

WAV files can store PCM audio (WAVE_FORMAT_PCM). The WAV file format specification says:

The data format and maximum and minimums values for PCM waveform samples of various sizes are as follows:

Sample Size Data Format Maximum Value Minimum Value
One to eight bits Unsigned integer 255 (0xFF) 0
Nine or more bits Signed integer i Largest positive value of i Most negative value of i
@javiercantero
javiercantero / xreadkeys.c
Last active June 19, 2025 10:16
A X11/Xlib program that reads the KeyPress and KeyRelease events from the window and prints them to the standard output. Used to debug the keyboard within X.
#include <X11/Xlib.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
Display *display;
Window window;
XEvent event;
int s;