Skip to content

Instantly share code, notes, and snippets.

View stuaxo's full-sized avatar
💭
 

Stuart Axon stuaxo

💭
 
View GitHub Profile
@anntzer
anntzer / cairo-manylinux.sh
Created October 9, 2017 21:25
manylinux build script for pycairo
#!/bin/bash
# Written by Antony Lee (@anntzer).
set -e
PYTHON_VERSION=36
PIP="/opt/python/cp$PYTHON_VERSION-cp${PYTHON_VERSION}m/bin/pip"
if ! [[ -e "$PIP" ]]; then
# Not in the manylinux image yet: call self from within docker.
docker run -it \
@KurtJacobson
KurtJacobson / header_bar.py
Last active September 11, 2024 19:17
Custom GTK+ HeaderBar with fullscreen toggle button
#!/usr/bin/env python
# Copyright (c) 2017 Kurt Jacobson
# License: https://kcj.mit-license.org/@2017
import os
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Gdk', '3.0')
@Miouyouyou
Miouyouyou / drm-prime-dumb-kms.c
Last active October 25, 2024 06:17
Simple example showing how to use DRM to : allocate a Dumb buffer on the GPU, use it as a framebuffer, use this CRTC on the currently connected screen (expecting 1 connected screen), export the buffer, reimport it implicitly with mmap and write in it.
// This will works on Embedded GPU that implements .gem_prime_mmap like Rockchip ones.
// This will fail on most DRM drivers for GPU with dedicated memory as they tend to NOT implement .gem_prime_mmap.
#include <stdio.h>
#include <libdrm/drm.h>
#include <stdint.h>
#include <sys/mman.h>
#include <string.h>
@Keenuts
Keenuts / readme.md
Last active February 5, 2025 20:50
GSoC 2017 | Virgl Windows Driver

GSOC 2017 | Virgl Windows Driver

Project links

The project is split into several parts:

  • The kernel driver, with simple 3D command forwarding and 3D resource allocation
  • The userland driver, in fact the OpenGL backend
  • The reference, explaining virtio-gpu commands

https://github.com/Keenuts/virtio-gpu-win-icd \

@hugodias
hugodias / docker-compose.yml
Last active October 17, 2017 17:31
Docker compose file for wordpress development
version: "2"
services:
my-wpdb:
image: mariadb
ports:
- "8081:3306"
environment:
MYSQL_ROOT_PASSWORD: ChangeMeIfYouWant
volumes:
- mariadb:/var/lib/mysql
@matthewjberger
matthewjberger / instructions.md
Last active April 20, 2025 02:17
Install a nerd font on ubuntu

1.) Download a Nerd Font

2.) Unzip and copy to ~/.fonts

3.) Run the command fc-cache -fv to manually rebuild the font cache

#!/usr/bin/python
from __future__ import print_function
import os
import sys
import OpenGL
# OpenGL.USE_ACCELERATE = False
# OpenGL.ERROR_CHECKING = False
from OpenGL.GLUT import *
from OpenGL.GLU import *
@Brainiarc7
Brainiarc7 / qt5-cxrosscompile-env-for-rpi.md
Created March 2, 2017 17:45
Setting up a Raspberry Pi QT5 cross compile environment on Linux

Generating an environment on Linux to cross-compile QT applications for a Raspberry Pi running Debian Wheezy:

Grab tools (for the cross-compiler tool chain) and firmware (for the OpenGL libraries) from the Raspberry Pi GitHub repository:

git clone https://github.com/raspberrypi/tools.git --depth=1
git clone https://github.com/raspberrypi/firmware.git --depth=1

Copy OpenGL stuff to the toolchain's sysroot:

@aras-p
aras-p / sampler.hlsl
Created February 13, 2017 12:13
Default sampler states in HLSL :(
// HLSL does allow initializing sampler states with a syntax
// like this. However the state settings themselves are nowhere
// to be found in the compiled shader bytecode (as of d3dcompiler_47.dll
// 10.0.14393 from Win10 SDK), and can't be accessed via ID3D11ShaderReflection
// either.
//
// Looks like the compiler only emits the sampler default values if compiling
// the deprecated "effect file" target.
//
// SAD!
@moonhouse
moonhouse / steps.sh
Created September 16, 2016 19:40
Installing apcmm on MacOS X
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
pip install cython
brew install liblo
pip install -r requirements.txt
python setup.py install
pip install pygame
brew install portmidi