Best news i’ve read… in quite some time!
Category Archives: OSX
Removing local git branches that aren’t in the remote repository
New trick of the day. If you wanna cleanup your local git branches that were already merged, you could use this bash alias:
alias git_cleanup='git branch --merged develop | grep -Ev "(master|release|hotfix|develop)" | xargs git branch -d'
Props to Nick + Maxime!
Fish Shell
Installing Fish:
[cc lang=”bash”]
brew install fish
[/cc]
Displaying the branch name in the prompt:
Place the following script here: ~/.config/fish/config.fish
[cc lang=”bash”]
set fish_git_dirty_color red
set fish_git_not_dirty_color green
function parse_git_branch
set -l branch (git branch 2> /dev/null | grep -e ‘\* ‘ | sed ‘s/^..\(.*\)/\1/’)
set -l git_diff (git diff)
if test -n “$git_diff”
echo (set_color $fish_git_dirty_color)$branch(set_color normal)
else
echo (set_color $fish_git_not_dirty_color)$branch(set_color normal)
end
end
function fish_prompt
if test -d .git
printf ‘%s@%s %s%s%s:%s> ‘ (whoami) (hostname|cut -d . -f 1) (set_color $fish_color_cwd) (prompt_pwd) (set_color normal) (parse_git_branch)
else
printf ‘%s@%s %s%s%s> ‘ (whoami) (hostname|cut -d . -f 1) (set_color $fish_color_cwd) (prompt_pwd) (set_color normal)
end
end
[/cc]
Reference here (Thanks for sharing the snippet!)
Fixing: StatusBar covering your UIViewController’s view
Ever since iOS 7, if you’re not using a UINavigationController instance, you’ll need to perform a very simple step, in order to prevent iOS’s StatusBar from covering your view:
1. Press Control, click over the “Top Layout Guide”, and drag it upon the troublesome view.
2. You’ll get a small popup. Please, click on “Vertical Spacing”.
3. Edit the new constraint, and update the Constant value, as needed.
CoreData HeavyWeight Migration Issues
We recently hit a pretty severe bug. In one of our apps, users began experiencing token issues after an upgrade.
Bottomline?… the last upgrade had a Heavyweight migration. So far so good, but what happened?. Turns out that the URIRepresentation that can be used to map a NSManagedObjectID, is and is not reliable. Everything is okay, until you perform a heavyweight migration!.
Heavyweight migrations might swizzle your NSManagedObjectID’s. Fix?, create your own primaryKeys. NSUUID helper class is the easiest way to accomplish that.