Skip to content

Instantly share code, notes, and snippets.

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

Scott Gardner scotteg

🏠
Working from home
View GitHub Profile
@Libranner
Libranner / synth.swift
Created June 12, 2020 13:05
AVSpeechSynthesizer + SwiftUI
import SwiftUI
import AVFoundation
struct ContentView: View {
var synthVM = SynthViewModel()
var body: some View {
VStack {
Text("This is Office Hours")
@JacopoMangiavacchi
JacopoMangiavacchi / MLCompute.swift
Last active January 15, 2021 07:14
MLCompute Playground
import Foundation
import MLCompute
import PlaygroundSupport
let page = PlaygroundPage.current
page.needsIndefiniteExecution = true
let tensor1 = MLCTensor(descriptor: MLCTensorDescriptor(shape: [6, 1], dataType: .float32)!)
let tensor2 = MLCTensor(descriptor: MLCTensorDescriptor(shape: [6, 1], dataType: .float32)!)
let tensor3 = MLCTensor(descriptor: MLCTensorDescriptor(shape: [6, 1], dataType: .float32)!)
@evansunleyjames
evansunleyjames / ConditionalTipModifier.swift
Last active June 6, 2024 16:20
A tip for showing TipKit tips conditionally in SwiftUI
/**
Conditionally include a tip - could be achieved with parameters on the tip, but this could save repetition if there are enough tips that depend on the same condition.
Usage:
.showTipConditionally(someCondition) { view in
view
.popoverTip(myTip)
.whateverOtherModifiers()
}
*/