Skip to content

Instantly share code, notes, and snippets.

View freeubi's full-sized avatar
🦒
Focusing

Zsolt Jandzsó freeubi

🦒
Focusing
View GitHub Profile
//
// EnvironmentBindable.swift
//
// Created by James Sedlacek on 3/6/24.
//
import SwiftUI
/// A property wrapper that provides a convenient way to bind observable objects from the environment
/// to a SwiftUI view. This wrapper simplifies the process of accessing and binding environment objects
@MiklinMA
MiklinMA / Xcode reset.scpt
Last active March 9, 2026 13:33
Xcode reset. An easy way to clear DerivedData, Xcode caches and module cache.
tell application "Xcode"
activate
set targetProject to active workspace document
repeat 60 times
if loaded of targetProject is true then
exit repeat
end if
delay 0.5
end repeat
@JamesSedlacek
JamesSedlacek / KeyboardToolbar.swift
Last active March 19, 2026 16:25
SwiftUI Keyboard Toolbar Workaround
//
// KeyboardToolbar.swift
//
// Created by James Sedlacek on 9/20/23.
//
import SwiftUI
import Combine
@Observable
@fullc0de
fullc0de / FullScreenPresent.swift
Last active July 30, 2025 03:04
UIKit style present in SwiftUI
//
// FullScreenPresent.swift
//
// Created by Heath Hwang on 5/16/20.
//
import SwiftUI
extension View {
/// This is used for presenting any SwiftUI view in UIKit way. As it uses some tricky way to make the objective, could possibly happen some issues at every upgrade of iOS version.
@htr3n
htr3n / macos-ramdisk.md
Last active March 16, 2026 22:26
Creating RAM disk in macOS

Built-in

diskutil erasevolume HFS+ 'RAM Disk' `hdiutil attach -nobrowse -nomount ram://XXXXX`

where XXXXX is the size of the RAM disk in terms of memory blocks.

Notes:

@zacwest
zacwest / ios-font-sizes.swift
Last active February 13, 2026 12:46
iOS default font sizes - also available on https://www.iosfontsizes.com
let styles: [UIFont.TextStyle] = [
// iOS 17
.extraLargeTitle, .extraLargeTitle2,
// iOS 11
.largeTitle,
// iOS 9
.title1, .title2, .title3, .callout,
// iOS 7
.headline, .subheadline, .body, .footnote, .caption1, .caption2,
]
@depth42
depth42 / gist:fbe19ed2ac953753e744
Created July 2, 2015 10:31
How to prevent Xcode from automatically restoring the last open project. This enables running multiple Xcode versions for different projects.
defaults write com.apple.dt.Xcode ApplePersistenceIgnoreState YES
@lachlanhurst
lachlanhurst / Simplify.swift
Created February 13, 2015 08:22
Simplification of a 3D polyline using the Ramer–Douglas–Peucker algorithm in Swift
//
// Simplify.swift
//
// Simplification of a 3D-polyline.
// A port of https://github.com/hgoebl/simplify-java for Swift
//
//
// The MIT License (MIT)
//
// Created by Lachlan Hurst on 10/02/2015.