Skip to content

Instantly share code, notes, and snippets.

View ryanlintott's full-sized avatar

Ryan Lintott ryanlintott

View GitHub Profile
@carlynorama
carlynorama / wwdc_2022_Friday_Sessions.txt
Last active June 10, 2022 20:06
WWDC 2022 sessions, names only
Accelerate machine learning with Metal
Author fast and reliable tests for Xcode Cloud
Bring multiple windows to your SwiftUI app
Build device-to-device interactions with Network Framework
Create Swift Package plugins
Create accessible Single App Mode experiences
Create custom catalogs at scale with ShazamKit
Discover Benchmarks in App Analytics
Discover Managed Device Attestation
Efficiency awaits: Background tasks in SwiftUI
@ryanlintott
ryanlintott / InfoDictionary.swift
Last active April 5, 2022 22:51
RotationMatchingOrientationViewModifier
//
// InfoDictionary.swift
// FrameUp
//
// Created by Ryan Lintott on 2021-05-11.
//
import SwiftUI
struct InfoDictionary {
// A URLSession extension that fetches data from a URL and decodes to some Decodable type.
// Usage: let user = try await URLSession.shared.decode(UserData.self, from: someURL)
// Note: this requires Swift 5.5.
extension URLSession {
func decode<T: Decodable>(
_ type: T.Type = T.self,
from url: URL,
keyDecodingStrategy: JSONDecoder.KeyDecodingStrategy = .useDefaultKeys,
dataDecodingStrategy: JSONDecoder.DataDecodingStrategy = .deferredToData,
dateDecodingStrategy: JSONDecoder.DateDecodingStrategy = .deferredToDate
@davidsteppenbeck
davidsteppenbeck / PreviewProviderModifier.swift
Last active October 31, 2022 10:30
A SwiftUI view modifier for simple preview providers.
import SwiftUI
enum PreviewProviderMode: CaseIterable {
/// Use for a light appearance preview.
case lightMode
/// Use for a dark appearance preview.
case darkMode
@jmcd
jmcd / RedmondButtonStyle.swift
Last active April 22, 2023 13:55
SwiftUI ButtonStyle that mimics classic beveled buttons from NeXTSTEP and Windows 95
import SwiftUI
extension Color {
static var redmondBackground = Color(white: 0.78)
static var redmondShadow = Color(white: 0.55)
}
extension Font {
static var redmondLabel = Font(UIFont(name: "MicrosoftSansSerif", size: UIFont.labelFontSize)!)
}
@heldr
heldr / addfont.cmd
Last active March 25, 2024 14:14
add windows fonts by command line
REM http://www.msfn.org/board/topic/119612-how-to-install-a-font-via-the-command-line/
@ECHO OFF
TITLE Adding Fonts..
REM Filename: ADD_Fonts.cmd
REM Script to ADD TrueType and OpenType Fonts for Windows
REM By Islam Adel
REM 2012-01-16
REM How to use: