Git of the day #14: git reset --keep HEAD^
Created a branch off the wrong place, but started working on changes? Keep changes while resetting a feature branch to a different place using the keep option.
Git of the day #13: git reset --soft HEAD^
Undo a git commit, without undoing the git add that staged the changes for the commit in the first place, keeping the working copy unchanged.
Git of the day #12: git checkout ref file
Restore a file to its state as it was in a previous or different commit.
Git of the day #11: git log --follow
Track file and folder moves when providing a path to git-log.
Git of the day #10: git add :/path/to/file
Specify a path relative to the root of the repository regardless of the current directory.
Git of the day #9: git log --first-parent
Show only ancestor commits that are the first parent of each commit in the tree.
Git of the day #8: git mv
Help Git update tracked changes on renamed and moved files, such as when changing the case of a filename.
Git of the day #7: git add --intent-to-add
Make Git aware of a new untracked file without staging its contents and adding it to the index.
Git of the day #6: git reset --hard ORIG_HEAD
Use ORIG_HEAD ref to reset HEAD back to the state before a rebase took place.
Git of the day #5: git rebase --interactive
Git history tells a story. Tell the best story you can using rebase.
Git of the day #4: git log --oneline --graph
A shorter log format with a fancy graph to show commit hierarchy clearly.
Git of the day #3: git add --patch
Begin an interactive session of adding hunks to the staging area,
Git of the day #2: git add --interactive
Start an interactive session with Git in the terminal.
Git of the day #1: git commit --amend --no-edit
Having created a commit, the commit can be edited with your staged changes.
SwiftUI SKStoreReviewController requestReview
It's possible to request a review from the user using SKStoreReviewController with SwiftUI. It's necessary to call requestReview(in:) and pass a UIWindowScene. SKStoreReviewController hasn't been updated for SwiftUI, so the API still interacts with UIKit, which is where UIWindowScene comes from.
SwiftUI if and if let view modifiers using ViewBuilder functions
Conditional view modifiers are possible with an extension to View, taking a conditional and a ViewBuilder closure to execute if the conditional is true. This allows for conditionally calling iOS 15-only APIs in SwiftUI.
SwiftUI portrait double column split view
To imitate a SplitViewController with SwiftUI and tile the master next to the detail in portrait, you can introspect the split view controller that SwiftUI creates underneath the SwiftUI declarations and make the necessary adjustments.
SwiftUI equal scaling text size to fit
SwiftUI tutorial for scaling all the words to be the same size. This makes the longest word fit and all the other words are the same font size of that longest word. SwiftUI has the ability to scale text to fit some bounds automatically, which we can use with the bounds being the width of the screen.
Set up WordPress caching on Cloudflare Free
Tutorial for setting up caching of a WordPress site on the free plan of Cloudflare with caching and support for logins, using Cache-Control headers to specify exactly how to cache different resources on your site.
Add custom entitlement to iOS app
Apply any custom entitlements, including private internal Apple entitlements, to an app bundle IPA, and sideload the IPA on to your iPhone or iPad. This can be used to allow any app access outside the app sandbox container, or to access iPhone functionality otherwise restricted like CarPlay.
Swift subclass an Objective-C class with protected init
A workaround to super.init() from your Swift subclass for Objective-C superclasses with an init marked unavailable, such as the CoreBluetooth framework's CBPeripheral.