Skip to content

Instantly share code, notes, and snippets.

View mickeyl's full-sized avatar
🏠
Working from home

Dr. Mickey Lauer mickeyl

🏠
Working from home
View GitHub Profile
@sebjvidal
sebjvidal / ViewController.swift
Created May 28, 2024 16:39
UICustomViewMenuElement Demo
//
// ViewController.swift
// UIMenu-Demo
//
// Created by Seb Vidal on 28/05/2024.
//
import UIKit
class ViewController: UIViewController {
@groue
groue / ObservableState.swift
Last active April 16, 2025 19:36
WithBindable
// Copyright (C) 2024 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:
//
@marckleinebudde
marckleinebudde / gs_usb-protocol.rst
Last active March 5, 2025 08:33
gs_usb protocol definition
enum gs_usb_breq {
    GS_USB_BREQ_HOST_FORMAT = 0,
    GS_USB_BREQ_BITTIMING,
    GS_USB_BREQ_MODE,
    GS_USB_BREQ_BERR,
    GS_USB_BREQ_BT_CONST,
    GS_USB_BREQ_DEVICE_CONFIG,
    GS_USB_BREQ_TIMESTAMP,
@tcldr
tcldr / ConcurrencyUtilities.swift
Last active April 23, 2023 12:48
Swift Concurrency Utilities for managing Transactional Resources
// A simple serial queue. Every operation sent through the queue will be executed
// in first-in first-out order. Every operation will complete its execution fully,
// even if it includes suspension points, prior to the next operation commencing.
//
// TIP: If calling from a global actor like @MainActor annotate your closure to
// get better ergonomics: `queue.send { @MainActor in /* ... */ }`
public final class AsyncSerialQueue: Sendable {
import os
public struct Gate<T: Sendable>: Sendable {
struct Pass: Sendable {
var value: T
var continuaton: UnsafeContinuation<Void, Never>
}
struct Pending: Sendable {
var continuation: UnsafeContinuation<T, Never>
//
// BikeRRUITests.swift
// BikeRRUITests
//
// Created by Oliver Epper on 14.08.21.
//
// swiftlint:disable all
import XCTest
@IanKeen
IanKeen / Storage.swift
Last active June 11, 2024 08:35
PropertyWrapper: Storage to extend support for more types using `@AppStorage`
@propertyWrapper
struct Storage<T: AppStorageConvertible>: RawRepresentable {
var rawValue: String { wrappedValue.storedValue }
var wrappedValue: T
init?(rawValue: String) {
guard let value = T.init(rawValue) else { return nil }
self.wrappedValue = value
}
init(wrappedValue: T) {
@chriseidhof
chriseidhof / ContentView.swift
Last active December 25, 2024 14:03
Variadic Views
import SwiftUI
struct MyValue: _ViewTraitKey {
static var defaultValue: Int = 0
}
extension View {
func myValue(_ value: Int) -> some View {
_trait(MyValue.self, value)
}
@dattasaurabh82
dattasaurabh82 / CH340N_linux_fix.md
Last active April 16, 2025 21:33
Fix Driver issues for CH340N usb serial chip in Linux (Ubuntu 22.04)

Tested on Ubuntu 20, 21 earlier and they were not working. So upgraded Ubutbu to latest 22 version.

The issue is: The built in Kernals of Ubuntu and many Linux Kernals (between ) have the CH340 drivers broken / have bugs and not fixed (from kernal 5.4.0-87 and above)

Note: I didn't try on linux kernal 5.4.0-86 my self. I though I will see how is the situation in the latest linux kernal (as of 16/05/2022)

Instructions for Ubuntu 22.04 LTS x86_64

@LilithWittmann
LilithWittmann / autobahn.md
Last active January 14, 2025 12:25
autobahn.md