Skip to content

Instantly share code, notes, and snippets.

@haikusw
haikusw / Devices.md
Created September 15, 2023 18:52 — forked from schwa/Devices.md
Metal 3 Availablity & GPU Family Table

Metal 3 Availablity & GPU Family Table

Device OS SOC Metal GPU Family
iPhone 6S & 6S Plus iOS 15 A8 2 Apple2
iPhone SE (1st generation) iOS 15 A9 2 Apple3
iPhone 7 & 7 Plus iOS 15 A10 Fusion 2 Apple3
iPod Touch (7th generation) iOS 15 A10 Fusion 2 Apple3
iPhone 8 & 8 Plus iOS 15, 16 A11 Bionic 2 Apple4
iPhone X iOS 15, 16 A11 Bionic 2 Apple4
@haikusw
haikusw / Best in Class iOS Checklist
Created July 13, 2023 20:10 — forked from DreamingInBinary/Best in Class iOS Checklist
This is a public checklist updated every year after the latest version of iOS and iPadOS are shipped. It's a boiled down version of a "Best in Class" app checklist created by Jordan Morgan.
# A Best in Class Checklist
A boiled down checklist adapted from this [post](https://www.swiftjectivec.com/a-best-in-class-app/), created by @jordanmorgan10.
> To use this, create a Github Issue in your own repo, and simply copy and paste this text.
## iOS Core Technology
_Things any iOS app can benefit from_
- [ ] iCloud Sync
- [ ] Focus Filter Support
@haikusw
haikusw / bookcase.scad
Created July 1, 2023 23:47 — forked from joeycastillo/bookcase.scad
VERY WORK-IN-PROGRESS case for Open Book Abridged Edition
// Render front side
front = true;
// Render back side
back = true;
// level of detail
level_of_detail = 60;
// The thickness of the PCB as fabricated
@haikusw
haikusw / IP.swift
Created June 3, 2023 05:32 — forked from CodaFi/IP.swift
An async sequence of kevents
#if canImport(Darwin)
import Darwin
#elseif canImport(Glibc)
import Glibc
#else
#error("unsupported platform")
#endif
/// Core utilities for interacting with IP-based abstractions.
public struct IP {
@haikusw
haikusw / Bundle+TestFlight.swift
Created June 2, 2023 19:56 — forked from lukaskubanek/Bundle+TestFlight.swift
A code snippet for detecting the TestFlight environment for a macOS app at runtime
import Foundation
import Security
extension Bundle {
/// Returns whether the bundle was signed for TestFlight beta distribution by checking
/// the existence of a specific extension (marker OID) on the code signing certificate.
///
/// This routine is inspired by the source code from ProcInfo, the underlying library
/// of the WhatsYourSign code signature checking tool developed by Objective-See. Initially,
@haikusw
haikusw / WWDC.json
Created May 26, 2023 18:51 — forked from harishgonnabattula/WWDC.json
WWDC 2015-2018 Video urls and summary
[
{"url": "https://devstreaming-cdn.apple.com/videos/wwdc/2018/236mwbxbxjfsvns4jan/236/236_hd_avspeechsynthesizer_making_ios_talk.mp4?dl=1", "title": "AVSpeechSynthesizer: Making iOS Talk", "summary": "Speech can enhance the audio experience of your app, whether you are generating spoken feedback for accessibility, or providing critical information beyond simple alerts or notifications. AVSpeechSynthesizer produces synthesized speech from text and allows you to control and monitor the progress of ongoing speech. Learn the ins and outs of AVSpeechSynthesizer and how to add computer-generated speech output to your app."},
{"url": "https://devstreaming-cdn.apple.com/videos/wwdc/2018/405bjty1j94taqv8ii/405/405_hd_measuring_performance_using_logging.mp4?dl=1", "title": "Measuring Performance Using Logging", "summary": "Learn how to use signposts and logging to measure performance. Understand how the Points of Interest instrument can be used to examine logged data. Get an introduction into creating and using custo
@haikusw
haikusw / swiftui.swift
Created March 15, 2023 06:53 — forked from chriseidhof/swiftui.swift
SwiftUI - iOS
import Combine
import CoreFoundation
import CoreGraphics
import CoreText
import Darwin
import Foundation
import SwiftUI
import UIKit
import os.log
import os
@haikusw
haikusw / ViewToPDF.swift
Created January 7, 2023 08:59 — forked from chriseidhof/ViewToPDF.swift
Image Rendering
import SwiftUI
extension View {
@MainActor
func pdf(size: ProposedViewSize) -> Data {
let renderer = ImageRenderer(content: self)
renderer.proposedSize = size
var pdfData = NSMutableData()
renderer.render { size, render in
var mediaBox = CGRect(origin: .zero, size: size)
@haikusw
haikusw / Macro_FCInfoToMouse.FCMacro
Created September 1, 2022 23:11 — forked from mario52a/Macro_FCInfoToMouse.FCMacro
Provide informations coordinates, length and angles in real time on the mouse in a bubble annotation displayed in the 3D screen
# -*- coding: utf-8 -*-
"""
***************************************************************************
* Copyright (c) 2016 <mario52> *
* *
* This file is a supplement to the FreeCAD CAx development system. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License (LGPL) *
* as published by the Free Software Foundation; either version 2 of *
@haikusw
haikusw / LayoutCallAsFunction.swift
Created July 8, 2022 20:09 — forked from ole/LayoutCallAsFunction.swift
SwiftUI: How any `Layout`-conforming type becomes a container view when it's used with a `@ViewBuilder` closure.
// Excerpt from `SwiftUI.framework/Modules/SwiftUI.swiftmodule/arm64-apple-ios.swiftinterface`
// in Xcode 14.0b1
//
// This is how any `Layout`-conforming type becomes a container view
// when it's used with a `@ViewBuilder` closure.
@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *)
extension SwiftUI.Layout {
@_alwaysEmitIntoClient public func callAsFunction<V>(@SwiftUI.ViewBuilder _ content: () -> V) -> some SwiftUI.View where V : SwiftUI.View {
return _VariadicView.Tree(
root: _LayoutRoot(self), content: content())