Skip to content

Instantly share code, notes, and snippets.

View steipete's full-sized avatar

Peter Steinberger steipete

View GitHub Profile
@steipete
steipete / firebase-iOS-breakdown
Created June 16, 2020 10:18 — forked from zntfdr/firebase-iOS-breakdown.swift
Firebase iOS Version breakdown
// How to:
// 1. Go in the Firebase Analytics Dashboard
// 2. Filter iOS Platform only
// 3. Scroll down, select `Device` under the "What is your audience like?" widget
// 4. Export the CSV data (top right of the corner, there's a `...` menu with Download CSV option)
// 5. Open the file and select the iOS breakdown raw data
// 6. Replace your data with the sample data in this script
// 7. Run the script in a Xcode Playground
// 8. See the terminal output
@steipete
steipete / gist:06f16ca092866e1d649fd46d45c3cb29
Last active June 7, 2020 15:51
Xcode 11.5 (16139) crash while renaming a file. FB7728364
Process: Xcode [2541]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: Xcode
Version: 11.5 (16139)
Build Info: IDEFrameworks-16139000000000000~62 (11E608c)
App Item ID: 497799835
App External ID: 835814967
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Xcode [2541]
Hello,
I'd like to request the following information, in accordance with the information rights in the GDPR, and particularly Article 15. Please address all points in this email in turn.
1. A copy of all my personal data held and/or undergoing processing, in a commonly used electronic form (Article 15(3)). Please note that this might also include any audiovisual material (e.g. voice-recordings or pictures) and is not necessarily limited to the information contained in your customer database and/or the information you make available through the ‘manage my profile’ functionality. For all data that would fall under Article 20 (portability), I would like to recieve this in a commonly-used machine readable format. For data that does not fall under Article 20, such as data inferred about me or opinions about me, I would like this in a commonly-used electronic format.
2. If any data was not collected, observed or inferred from me directly, precise information about the source of that data, including the name and c
@steipete
steipete / gist:357387b28d714da6c1e8f47b6924a571
Created June 2, 2020 20:04
macOS graphics driver is cursed
Process: Screens 4 [66291]
Path: /Applications/Screens 4.app/Contents/MacOS/Screens 4
Identifier: com.edovia.screens4.mac
Version: 4.7.5 (14936)
App Item ID: 1224268771
App External ID: 835721196
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Screens 4 [66291]
User ID: 501
//
// Copyright © 2020 Peter Steinberger. MIT Licensed.
//
import Foundation
/// Text input can crash in Mac Catalyst due to a property not being atomic.
/// We swizzle the `documentState` property of `RTIInputSystemSession` to make it thread safe.
func installMacCatalystAppKitTextCrashFix() {
// RTIInputSystemSession is loaded later, so we will check a few times.
@steipete
steipete / gist:7a125b20cce461bf9a072dfacd805507
Created May 20, 2020 09:13
Twitter app crashing on 10.15.5b4
Process: Twitter [18613]
Path: /Applications/Twitter.app/Contents/MacOS/Twitter
Identifier: Twitter
Version: 8.19 (8.19.1)
App Item ID: 1482454543
App External ID: 835910359
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Twitter [18613]
User ID: 501
@steipete
steipete / gist:504e79558d861211a3a9ff794e09c817
Created May 20, 2020 07:47
Twitter crash on 12-inch MBP on macOS 10.15.4 stable
Process: Twitter [45863]
Path: /Applications/Twitter.app/Contents/MacOS/Twitter
Identifier: Twitter
Version: 8.19 (8.19.1)
App Item ID: 1482454543
App External ID: 835910359
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Twitter [45863]
User ID: 501
// Run any SwiftUI view as a Mac app.
import Cocoa
import SwiftUI
public func run<V: View>(view: V) {
let delegate = AppDelegate(view)
let app = NSApplication.shared
NSApp.setActivationPolicy(.regular)
app.mainMenu = app.customMenu
@steipete
steipete / gist:92f66ec9387e8e4c7c17ffebb0824a8e
Created May 14, 2020 07:22
deciphering kernel debug=0x104c44
Need to run with csrutil disable or recovery
sudo nvram boot-args="debug=0x104c44”
0x104c44 = 1 0000 0100 1100 0100 0100
DB_NMI 0x4 // changes the power-button to create a non-maskable interrupt?
DB_ARP 0x40 // allows debugging across subnets via ARP?
DB_KERN_DUMP_ON_PANIC 0x400 // Trigger core dump on panic
@steipete
steipete / FirebaseCoordinator.swift
Created April 13, 2020 13:38
If you're as confused as I am that there's an API for custom options, yet Google still requires a file named GoogleService-Info.plist in your app, here's some swizzling that fixes that for ya. All Swift :)
class FirebaseCoordinator {
static let shared = FirebaseCoordinator()
static let initialize: Void = {
/// We modify Google Firebase (and eventually Analytics) to load the mac-specific plist at runtime.
/// Google enforces that we have a file named "GoogleService-Info.plist" in the app resources.
/// This is unfortunate since we need two different files based on iOS and Mac version
/// One solution is a custom build step that copies in the correct file:
/// https://stackoverflow.com/questions/37615405/use-different-googleservice-info-plist-for-different-build-schemes
/// However, this is basically impossible since Catalyst doesn't set any custom build variables, so detection is extremely difficult.
/// We swizzle to modify the loading times.