Skip to content

Instantly share code, notes, and snippets.

@rossant
rossant / glwidget.py
Created November 26, 2018 17:14
Minimal modern PyQt5, OpenGL, QOpenGLWindow working example
#!/usr/bin/env python3
"""
Code from http://www.labri.fr/perso/nrougier/python-opengl/#the-hard-way
"""
import ctypes
import logging
@superblaubeere27
superblaubeere27 / GLSLSandboxShader.java
Last active February 25, 2023 18:04
GLSLSandbox Renderer, compatible with LWJGL 2 - 3 (compatible for minecraft)
/*
* Copyright (c) superblaubeere27 2020
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOF
@1player
1player / list-unused-flatpak-directories.sh
Created June 14, 2022 09:14
Show all unused ~/.var/app directories from uninstalled Flatpaks, and their size
#!/bin/bash
set -euo pipefail
base_dir=$(realpath $HOME/.var/app --relative-to=$(pwd))
comm -13 <(flatpak list --columns=application | sort) <(ls -1 $HOME/.var/app/ | sort) \
| sed "s#^#$base_dir/#" | tr '\n' '\0' | du -sch --files0-from=-
@n8allan
n8allan / libpsresample.cpp
Created March 15, 2023 17:17
Interface for the Raspberry Pi Broadcom ISP (/dev/video12) via V4L2 M2M
#include <stdio.h>
#include <stdlib.h>
#include <memory>
#include <cstring>
#include <vector>
#include <string.h>
#include <assert.h>
#include <getopt.h> /* getopt_long() */
#include <fcntl.h> /* low-level i/o */