Skip to content

Instantly share code, notes, and snippets.

View rastersize's full-sized avatar

Aron Cedercrantz rastersize

View GitHub Profile
@Sherlouk
Sherlouk / DebugDevice.swift
Last active June 6, 2024 19:38
Debug Profiles - Securely debugging in production
//
// DebugDevice.swift
//
// Copyright 2022 • Sidetrack Tech Limited
//
import Foundation
// This must be called on the main-thread.
var isDebugProfileInstalled: Bool {
@Arutyun2312
Arutyun2312 / CustomGeometryReader.swift
Last active May 6, 2024 17:10
Custom Geometry Reader
//
// CustomGeometryReader.swift
//
//
// Created by Arutyun Enfendzhyan on 10.01.22.
//
import SwiftUI
struct CustomGeometryReader: View {

This page is now depreacted!

Check out the repo instead. The Wisdom of Quinn Now with 100% more archived PDFs.

The Wisdom of Quinn

Informative DevForum posts from everyone's favorite DTS member.

(Arranged newest to oldest)

@steipete
steipete / KeyCommand.swift
Last active January 2, 2024 13:26
Add Keyboard Shortcuts to SwiftUI on iOS 13 when using `UIHostingController`. Requires using KeyboardEnabledHostingController as hosting class) See https://steipete.com/posts/fixing-keyboardshortcut-in-swiftui/
//
// KeyCommand.swift
// Adds Keyboard Shortcuts to SwiftUI on iOS 13
// See https://steipete.com/posts/fixing-keyboardshortcut-in-swiftui/
// License: MIT
//
// Usage: (wrap view in `KeyboardEnabledHostingController`)
// Button(action: {
// print("Button Tapped!!")
// }) {
@htr3n
htr3n / macos-ramdisk.md
Last active July 26, 2024 18:20
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:

@mohanpedala
mohanpedala / bash_strict_mode.md
Last active July 26, 2024 08:00
set -e, -u, -o, -x pipefail explanation
@shaps80
shaps80 / Image+Color.swift
Created September 10, 2018 12:41
Swift Image from Color. Supports both UIImage and NSImage for cross-platform compatibility.
#if os(iOS)
import UIKit
public typealias PlatformImage = UIImage
public typealias PlatformColor = UIColor
#else
import AppKit
public typealias PlatformImage = NSImage
public typealias PlatformColor = NSColor
#endif
@JoeMatt
JoeMatt / Carthage.sh
Last active November 14, 2019 21:19
Improve Carthage performance with Per-target manifest caching and optional Fastlane usage
set -e
# carthage.sh : smarter carthage updating and caching by Joe Mattiello
#
# Inspired from http://shashikantjagtap.net/cache-carthage-speed-ios-continuous-integration/
#
# The purpose of this script is to reduce the amount of checkouts Carthage runs.
# I use this script in an XCode 'run script' build phase as the first phase before compiling
# If you have mutliple targets, projects, frameworks etc, you can include this script in each and it will selec
# the correct Carthage folder for each target.
@DougGregor
DougGregor / dynamic_member_lookup_environment.swift
Created May 2, 2018 16:59
Using Swift 4.2's @dynamicMemberLookup to expose environment variables
import Darwin
@dynamicMemberLookup
struct Environment {
subscript(dynamicMember name: String) -> String? {
get {
guard let value = getenv(name) else { return nil }
return String(validatingUTF8: value)
}
@artemnovichkov
artemnovichkov / file_sharing.swift
Last active September 13, 2022 14:20
Explore Documents folder in Files.app. Inspired by Ole's tweet https://twitter.com/olebegemann/status/987346188591681536
#!/usr/bin/env xcrun --sdk macosx swift
import Foundation
enum Configuration: String {
case debug = "Debug"
case release = "Release"
}
// Get Info.plist path