Skip to content

Instantly share code, notes, and snippets.

View colemancda's full-sized avatar
🏎️
Working with Swift on ARM

Alsey Coleman Miller colemancda

🏎️
Working with Swift on ARM
View GitHub Profile
@JeodC
JeodC / rocknix-wine-distro-guide.md
Last active March 10, 2026 02:34
A guide for creating and distributing wine bottles for use with rocknix

Distributing Wine Bottles for ROCKNIX

If you're new to setting up Wine Bottles in ROCKNIX, then you should read qcs-wine-bottles.md first.

This guide is intended for people who wish to share their functional wine bottles with others, for easier consumption. The system used in this guide is extremely similar to PortMaster and the system used for packaging ports. There are three simple terms used throughout:

  • .winecellar: This is a user-created folder that ideally lives in roms/windows. It is meant to store shared custom binaries to help with running wine bottles (such as tools/splash) and custom wine builds.
  • bottle.json: This json file is similar to port.json in that it holds identifying information about the game it's bundled with. Launch scripts will use jquery to parse this file to correctly configure wine for the game.
  • winecask.json: This json file is a merged combination of all bottle.json files in a GitHub reposito
@JeodC
JeodC / qcs-wine-bottles.md
Last active November 26, 2025 16:26
A beginner's guide to creating wine bottles for Qualcomm series handhelds

Rocknix Wine Bottles

Using wine is a deep rabbit hole for anyone not familiar with the software, and an even deeper rabbit hole when combined with box86 or box64. This guide attempts to serve as a basic introduction to using the built-in wine and box packages included with Rocknix on a Retroid Pocket 5. While the Retroid Pocket Mini is a similar setup chain, it is weaker hardware than the Retroid Pocket 5 and thus the examples provided here may not function as well.

If you are familiar with this process, you may be interested in a slightly more advanced distribution guide.

Terminology - Wine and Box86/64

The first thing anyone should understand is the vernacular used throughout this guide. Two tools are used to make wine ports possible on ARM64:

  • Box86 and Box64 by ptitSeb are Linux x86 and x86_64 emulators targeting AARCH64/ARM64 architecture.
@futurejones
futurejones / swift-apt-repo-install.sh
Last active October 10, 2023 12:54
Install script for the Swift Community Apt Repository - https://swiftlang.xyz
#! /bin/bash
#
# Install script for the Swift Community Apt Repository - swiftlang.xyz
#
# check distribution version and infer distro with switch/case
## as all distribution versions have different names we can use this information to infer the distribution name.
check_ver () {
for var in "${SUPPORTED_VER[@]}"
do
@akihikodaki
akihikodaki / README.en.md
Last active March 11, 2026 03:20
Linux Desktop on Apple Silicon in Practice

Linux Desktop on Apple Silicon in Practice

NOTE: Time flies, and it's been almost five years(!) since I wrote this. Beaware the text below is now outdated (e.g., now Asahi Linux has graphics acceleration even better than this). The commands listed are up-to-date.

I bought M1 MacBook Air. It is the fastest computer I have, and I have been a GNOME/GNU/Linux user for long time. It is obvious conclusion that I need practical Linux desktop environment on Apple Silicon.

@squeuei
squeuei / lichee-nano-fel.md
Last active November 22, 2024 14:09
How to enter FEL mode on Lichee nano

How to enter FEL mode on Lichee nano

If SPI flash isn't on the board, just remove the TF(microSD) card from the board and supply the power. It's the same if SPI flash is empty,

If your board have a SPI flash with preloaded image, pull D4(SPI CLK) down to GND. You can use the metal part of USB micro B or TF card slot as GND. Diagram is in the comment below. Thanks: @ernestp for the correction and providing a diagram.

Or you can use the special boot image [link]. Just write it to a TF card and boot.

Don't forget to remove the GND connection after entering FEL mode otherwise you will never be able to write the boot image to the SPI flash.

apt-get install qemu qemu-user qemu-user-static binfmt-support debootstrap binutils
sudo debootstrap --foreign --arch i386 stretch  ./chroot-stretch-i386/ http://deb.debian.org/debian/
mount -t sysfs /sys ./chroot-stretch-i386/sys/
mount -t proc /proc ./chroot-stretch-i386/proc/
mount –-bind /dev ./chroot-stretch-i386/dev/
mount –-bind /dev/pts ./chroot-stretch-i386/dev/pts/
@AvdLee
AvdLee / DarwinNotificationCenter.swift
Last active March 25, 2025 19:09
A notification center for Darwin Notifications. MIT License applies.
//
// DarwinNotificationCenter.swift
//
// Copyright © 2017 WeTransfer. All rights reserved.
//
import Foundation
/// A Darwin notification payload. It does not contain any userInfo, a Darwin notification is purely event handling.
public struct DarwinNotification {
@AliSoftware
AliSoftware / Bindings.swift
Last active August 5, 2025 14:50
Re-implementation of @binding and @State (from SwiftUI) myself to better understand it
/*:
This is a concept re-implementation of the @Binding and @State property wrappers from SwiftUI
The only purpose of this code is to implement those wrappers myself
just to understand how they work internally and why they are needed,
⚠️ This is not supposed to be a reference implementation nor cover all
subtleties of the real Binding and State types.
The only purpose of this playground is to show how re-implementing
them myself has helped me understand the whole thing better
@Azoy
Azoy / syscall.swift
Last active August 25, 2023 21:49
Raw system calls in Swift
// macOS x86_64 syscall works as follows:
// Syscall id is moved into rax
// 1st argument is moved into rdi
// 2nd argument is moved into rsi
// 3rd argument is moved into rdx
// ... plus some more
// Return value is stored in rax (where we put syscall value)
// Mac syscall enum that contains the value to correctly call it
enum Syscall: Int {
@steipete
steipete / UIKit+iOSMac.h
Last active February 6, 2022 14:53
iOSMac Marzipan Toolbar Access. Learn more at https://speakerdeck.com/steipete/hacking-marzipan
#import <Foundation/Foundation.h>
@class NSString, UHASToolbarItem;
__attribute__((weak_import)) @interface _UIWindowToolbarItem : NSObject
@property(readonly, copy, nonatomic) NSString *label;
@property(readonly, copy, nonatomic) NSString *identifier;
- (id)initWithIdentifier:(id)arg1;