Skip to content

Instantly share code, notes, and snippets.

View pbk20191's full-sized avatar

Byeong Gwan pbk20191

View GitHub Profile
@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