Skip to content

Instantly share code, notes, and snippets.

View Clafou's full-sized avatar

Seb Molines Clafou

View GitHub Profile
@Clafou
Clafou / gist:6728543
Last active December 24, 2015 02:09 — forked from MartinMoizard/gist:6537467
Edited the original Gist to remove the call to presentModalViewController:animated:, which simplifies it and removes its parameter. This method has the sole aim of finding the adequate UIViewController. It's up to this method's caller to send presentModalViewController:animated:
- (UIViewController *)modalPresenter
{
if ([self isKindOfClass:[UINavigationController class]]) {
return [((UINavigationController *)self).topViewController modalPresenter];
} else if (self.presentedViewController) {
return [self.presentedViewController modalPresenter];
} else {
return self;
}
}
@Clafou
Clafou / gist:3f8cf649d6eace226273a31f434ab7ee
Created February 15, 2018 12:48
Rename files created by iOS Simulator, to give them names such as "1.iPhone X.png"
i=0;for old in *.png; do i=$((i+1)); new=$i.$(echo "$old" | sed 's/Simulator Screen Shot - \(.*\) -.*/\1\.png/'); mv "$old" "$new"; done
@Clafou
Clafou / gist:6cfa71c466bccbcdbff5261e98b11371
Created March 30, 2022 12:54
Simplified command line usage of Transporter (Apple's tool for managing App Store Connect metadata)
# Download Transporter by Apple from the Mac App Store
# Then one-time init on your computer to store your login in keychain.
# (Don't use your main account, create one in App Store Connect with role App Manager!)
security add-generic-password -a "$USER" -s 'Transporter Username' -w '<App Store Connect email>'
security add-generic-password -a "$USER" -s 'Transporter Password' -w '<App Store Connect password>'
# Then:
alias Transporter="/Applications/Transporter.app/Contents/itms/bin/iTMSTransporter -u '$(security find-generic-password -s 'Transporter Username' -w)' -p '$(security find-generic-password -s 'Transporter Password' -w)'"
# And (optional, used in examples below, replace it with your own Apple-assigned App ID)