Skip to content

Instantly share code, notes, and snippets.

View pbk20191's full-sized avatar

Byeong Gwan pbk20191

View GitHub Profile
@lzlrd
lzlrd / wslg-guide.md
Last active June 30, 2025 02:05
How to get WSLg working with OpenGL, Vulkan, and CUDA on (Official) Arch Linux and Ubuntu WSL Instances.

WSLg with OpenGL, Vulkan, and CUDA on (Official) Arch Linux and Ubuntu WSL Instances

Note: I haven't documented CUDA here. I'm lazy (and haven't tested on Arch). See https://documentation.ubuntu.com/wsl/en/latest/howto/gpu-cuda for that on Ubuntu.

Context

microsoft/wslg#1312:

So I got this working on both Ubuntu, and Arch. First, start with a fresh install (of archlinux from https://gitlab.archlinux.org/archlinux/archlinux-wsl or Ubuntu from wsl --install Ubuntu or https://apps.microsoft.com/detail/9pdxgncfsczv).

Arch

@KubaO
KubaO / winmsgasyncio.py
Last active December 9, 2024 01:16
Python 3.12 asyncio ProactorEventLoop integration with Windows message pump / event loop and tkinter event loop
"""
An event loop policy that integrates Windows message loop with IOCP-based async processing.
Usage:
asyncio.set_event_loop_policy(winmsgasyncio.MsgProactorEventLoopPolicy())
To integerate with tkinter, use tk_sync_mainloop(root) or await tk_async_mainloop(root).
"""
# SPDX-License-Identifier: MIT
@karambirov
karambirov / UIHostingController+SafeArea.swift
Last active September 25, 2024 12:45
How to ignore safe area in UIHostingController
import SwiftUI
extension UIHostingController {
convenience public init(rootView: Content, ignoreSafeArea: Bool) {
self.init(rootView: rootView)
if ignoreSafeArea {
disableSafeArea()
}
@klo2k
klo2k / gist:fe794f107c11292ba47b4d052c547983
Created February 12, 2022 08:01
Install virt-manager in Windows 11 WSL (qemu, Windows Subsystem for Linux)
# Inside WSL...
# Install virt-manager
sudo apt install -y virt-manager
# Add youself to kvm and libvirt group
sudo usermod --append --groups kvm,libvirt "${USER}"
# Fix-up permission to avoid "Could not access KVM kernel module: Permission denied" error
sudo chown root:kvm /dev/kvm
@pd95
pd95 / DemoApp.swift
Last active March 26, 2023 09:04
A `DocumentGroup` demo app (based on the Xcode iOS app template with Core Data enabled) illustrating wrapping `UIManagedDocument` using SwiftUI `ReferenceFileDocument`
/*
How to use the content of this gist:
- Create a new iOS app using the "App" template,
set the product name to "Demo", use "SwiftUI" for interface and enable Core Data.
- go to the apps target (=click the Project "Demo" and select "Demo" as under "Targets")
- select the "Info" tab
@evands
evands / combine_static_libraries.sh
Created January 14, 2015 20:40
Combine multiple .a static libraries, which may each have multiple architectures, into a single static library
#!/bin/sh
# Combined all static libaries in the current directory into a single static library
# It is hardcoded to use the i386, armv7, and armv7s architectures; this can easily be changed via the 'archs' variable at the top
# The script takes a single argument, which is the name of the final, combined library to be created.
#
# For example:
# => combine_static_libraries.sh combined-library
#
# Script by Evan Schoenberg, Regular Rate and Rhythm Software