Skip to content

Instantly share code, notes, and snippets.

View stuaxo's full-sized avatar
💭
 

Stuart Axon stuaxo

💭
 
View GitHub Profile
Install [Meson and ninja](https://mesonbuild.com/Getting-meson.html).
Build cairo
Disable some options to avoid compile/link errors
```
git clone --depth 1 https://gitlab.freedesktop.org/cairo/cairo.git
meson --prefix=c:\path\to\install --buildtype release -D tests=disabled -D gl-backend=disabled cairo_builddir cairo
meson compile -C cairo_builddir
meson install -C cairo_builddir
```
@sangwoo-joh
sangwoo-joh / libcst_transformer.py
Last active June 14, 2022 03:56
A rough example code for renaming variables using libcst.
import libcst
import difflib
from termcolor import colored
class RenameTransformer(libcst.CSTTransformer):
def __init__(self, rename_pairs):
self.rename_pairs = rename_pairs
self.restore_keywords = []
@bingzhangdai
bingzhangdai / 9p_virtio.md
Created July 18, 2020 08:13
Set up VirtFS (9p virtio) for sharing files between Guest and Host on Proxmox VE

How-to

  1. On Host(PVE), edit /etc/pve/qemu-server/VMID.conf
args: -fsdev local,security_model=mapped,id=fsdev0,path=/path/to/share -device virtio-9p-pci,id=fs0,fsdev=fsdev0,mount_tag=hostshare

This tells qemu to create a 9pvirtio device exposing the mount_tag hostshare (just a name to identify the mount point). That device is coupled to an fsdev named fsdev0, which specifies which portion of the host filesystem we are sharing, and in which mode.

@mjpieters
mjpieters / # Sourcemap processing in Python.md
Last active December 15, 2023 11:32
Python sourcemap parsing

Sourcemap processing in Python

This gist contains two Python modules:

  • sourcemap: a module to parse and generate JavaScript source maps
  • base64vlq: code to decode and encode base64 VLQ sequences, an encoding used in source maps.

License

The code is licensed under the terms of the MIT license, included in the gist.

@strycore
strycore / dbusrr.py
Created November 11, 2019 16:37
DBus resolution switch for Mutter
"""DBus backed display management for Mutter"""
from collections import defaultdict
import dbus
class DisplayMode:
def __init__(self, mode_info):
self.mode_info = mode_info
msys2 vs msys vs msysgit
MinGW doesn't provide a linux-like environment, that is MSYS(2) and/or Cygwin
Cygwin is an attempt to create a complete UNIX/POSIX environment on Windows.
MinGW is a C/C++ compiler suite which allows you to create Windows executables - you only
need the normal MSVC runtimes, which are part of any normal Microsoft Windows installation.
MinGW provides headers and libraries so that GCC (a compiler suite,
not just a "unix/linux compiler") can be built and used against the Windows C runtime.
@kgantsov
kgantsov / revoke_celery_tasks.py
Created January 2, 2019 11:22
Helper functions that revokes celery tasks by name and ID
from celery.task.control import revoke
from celery.task.control import inspect
def revoke_tasks_by_name(task_name, worker_prefix=''):
"""
Revoke all tasks by the name of the celery task
:param task_name: Name of the celery task
:param worker_prefix: Prefix for the worker
program firetest;
{ Classic fire animation using VGA mode 13h and colors 0 to 63... wee !!! }
uses Crt, VGA;
var i, heat: Integer;
quit: Boolean;
c: Char;
@HarlemSquirrel
HarlemSquirrel / pulseaudio-dlna.service
Last active December 9, 2024 02:43
a pulseaudio-dlna Unit file for systemd
## Systemd user unit file for pulseaudio-dlna
# Copy to: ~/.config/systemd/user/pulseaudio-dlna.service
# Enable: systemctl --user enable pulseaudio-dlna
[Unit]
Description=PulseAudio-DLNA Service
[Install]
WantedBy=default.target