Skip to content

Instantly share code, notes, and snippets.

View rogelin's full-sized avatar
🐀
...

Rogelin rogelin

🐀
...
View GitHub Profile
@groue
groue / ObservableState.swift
Last active May 5, 2025 12:41
WithBindable
// Copyright (C) 2025 Gwendal Roué
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
@simonbs
simonbs / Proxy.swift
Created November 4, 2023 19:09
Property wrapper for proxying values.
@propertyWrapper
struct Proxy<EnclosingType, Value> {
typealias ValueKeyPath = ReferenceWritableKeyPath<EnclosingType, Value>
typealias SelfKeyPath = ReferenceWritableKeyPath<EnclosingType, Self>
static subscript(
_enclosingInstance instance: EnclosingType,
wrapped wrappedKeyPath: ValueKeyPath,
storage storageKeyPath: SelfKeyPath
) -> Value {
@chriseidhof
chriseidhof / ContentView.swift
Last active May 9, 2025 15:12
Variadic Views
import SwiftUI
struct MyValue: _ViewTraitKey {
static var defaultValue: Int = 0
}
extension View {
func myValue(_ value: Int) -> some View {
_trait(MyValue.self, value)
}
@zg
zg / freebsd-qemu-xhyve-mac-os-x-virtual-machine.md
Last active March 22, 2025 20:32
Create FreeBSD virtual machine using qemu. Run the VM using xhyve.

TL;DR

  • Create 10GB FreeBSD image using QEMU.
  • Run the VM using xhyve.
  • Mount host directory.
  • Resize the image.

Requisites