Skip to content

Instantly share code, notes, and snippets.

View tahirmt's full-sized avatar
💭
I may be slow to respond.

Mahmood Tahir tahirmt

💭
I may be slow to respond.
  • theScore
  • Toronto, ON
View GitHub Profile
@tahirmt
tahirmt / generate-target-dependencies.sh
Created January 25, 2024 15:53 — forked from wakinchan/generate-target-dependencies.sh
Generate Target Dependencies for Package.swift
#!/usr/bin/env sh
# usage: sh ./generate-target-dependencies.sh | dot -Tsvg -o target-graph.svg
packages=`swift package describe --type json`
targets=`echo $packages | jq '.targets'`
target_names=`echo $targets | jq -r '.[] | .name'`
body=""
template=`cat <<EOF
digraph DependenciesGraph {
@tahirmt
tahirmt / swiftlint.sh
Created March 2, 2023 23:20 — forked from teameh/swiftlint.sh
Swiftlint pre-commit script
#!/bin/bash
set -e
if [ "$CI" == true ]; then
echo "CI == true, skipping this script"
exit 0
fi
SWIFT_LINT=./Pods/SwiftLint/swiftlint
@tahirmt
tahirmt / printObjectMemoryAddress.swift
Created November 22, 2022 16:17 — forked from IamMarik/printObjectMemoryAddress.swift
print object memory address #swift
print(Unmanaged.passUnretained(self).toOpaque())
@tahirmt
tahirmt / Apple_mobile_device_types.txt
Created February 15, 2022 17:43 — forked from adamawolf/Apple_mobile_device_types.txt
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@tahirmt
tahirmt / BetterXcodeJumpToCounterpartSwift.org
Created January 6, 2022 03:40 — forked from danielmartin/BetterXcodeJumpToCounterpartSwift.org
Add support for a better Xcode's Jump to Next Counterpart in Swift

If you work on a Swift project that follows the Model-View-ViewModel (MVVM) architecture or similar, you may want to jump to counterpart in Xcode from your view to your model, and then to your view model. (ie. by using Ctrl+Cmd+Up and Ctrl+Cmd+Down).

You can do this in recent versions of Xcode by setting a configuration default.

From a terminal, just type this command and press Enter:

defaults write com.apple.dt.Xcode IDEAdditionalCounterpartSuffixes -array-add "ViewModel" "View"
@tahirmt
tahirmt / ios-xcode-device-support.sh
Created September 24, 2021 19:22 — forked from steipete/ios-xcode-device-support.sh
Using iOS 15 devices with Xcode 12.5 (instead of Xcode 13)
# The trick is to link the DeviceSupport folder from the beta to the stable version.
# sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :)
# Support iOS 15 devices (Xcode 13.0) with Xcode 12.5:
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
# Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions
# (A similar approach works for older versions too, just change the version number after DeviceSupport)