Skip to content

Instantly share code, notes, and snippets.

@muhammetkole
muhammetkole / git_rebase.md
Created January 15, 2021 10:36 — forked from ravibhure/git_rebase.md
Git rebase from remote fork repo

In your local clone of your forked repository, you can add the original GitHub repository as a "remote". ("Remotes" are like nicknames for the URLs of repositories - origin is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version. In terms of commands that might look like:

Add the remote, call it "upstream":

git remote add upstream https://github.com/whoever/whatever.git

Fetch all the branches of that remote into remote-tracking branches, such as upstream/master:

git fetch upstream

@muhammetkole
muhammetkole / API links
Last active January 10, 2021 19:46
APIs for testing purposes
@muhammetkole
muhammetkole / notification.apns
Created September 15, 2020 20:46
Example apns file for testing push notifications
{
"Simulator Target Bundle": "com.your.targets.bundle.identifier",
"aps": {
"alert": "Push Notifications Test",
"sound": "default",
"badge": 1
}
}
@muhammetkole
muhammetkole / bash-commands.md
Last active December 29, 2021 13:00 — forked from katronai/bash-commands.md
These are the most useful commands for myself working on Terminal

Bash Commands

  • ls -p
    Puts / at the end of directories while listing

  • cd ..
    Change to the parent directory

  • cd -
    Change to the previous directory

@muhammetkole
muhammetkole / BetterXcodeJumpToCounterpartSwift.org
Created January 7, 2020 12:41 — 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"

Useful Commands

Xcode Enviroment Variables

  • See answer at

  • xcodebuild -project myProj.xcodeproj -target "myTarg" -showBuildSettings

MacOS Enviroment Variables

Git

Tag

  • git tag

    • List all tags
  • git tag <tag-name>

Data inspection

  • print out -> po

    -you can implement description method to get nicer explanations about the object

    -po self.myCar

  • print -&gt; p

Xcode Command line tools

  • Change default Xcode:

    • sudo xcode-select --switch /Applications/Xcode7_3_1.app
  • See selected Xcode:

    • xcode-select --print-path
  • Build project:

    • xcodebuild -list -project .xcodeproj