- Separate subject from body with a blank line
- Limit the subject line to 50 characters
- Capitalize the subject line
- Do not end the subject line with a period
- Use the imperative mood in the subject line
- Wrap the body at 72 characters
- Use the body to explain what and why vs. how
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (UITableView *)parentTableView { | |
// iterate up the view hierarchy to find the table containing this cell/view | |
UIView *aView = self.superview; | |
while(aView != nil) { | |
if([aView isKindOfClass:[UITableView class]]) { | |
return (UITableView *)aView; | |
} | |
aView = aView.superview; | |
} | |
return nil; // this view is not within a tableView |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
included: | |
- {Project folder} | |
- {Project test folder} | |
excluded: | |
- {Project folder}/Extensions/UIImage+Assets.swift # automatically generated file | |
opt_in_rules: | |
- closure_spacing # closure should have single space inside each brace | |
- empty_count # prefer isEmpty over comparing to 0 | |
- number_separator # underscore should be used as thousand separator in large decimal numbers | |
disabled_rules: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Credits to fuckbecauseican5 from https://www.reddit.com/r/hackintosh/comments/4s561a/macos_sierra_16a238m_install_success_and_guide/ | |
# Adapted to work with the official image available into Mac App Store | |
# | |
# Enjoy! | |
hdiutil attach /Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app | |
hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J | |
hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ (instancetype)sharedInstance { | |
static dispatch_once_t once; | |
static NSMutableDictionary *sharedInstances; | |
dispatch_once(&once, ^{ | |
// Creating of the container for shared instances for different classes | |
sharedInstances = [NSMutableDictionary new]; | |
}); | |
id sharedInstance = nil; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
co = checkout | |
ci = commit | |
st = status | |
br = branch | |
hist = log --graph --pretty=format:\"%Cred%h%Creset %Cred|%Creset %s%C(cyan)%d%Creset\" | |
histFull = log --graph --pretty=format:\"%Cred%h%Creset %ad %Cred|%Creset %s%C(cyan)%d %Cgreen(%cr) %Cblue[%an]%Creset\" --date=short | |
last = log -n1 --graph --pretty=format:\"%Cred%h%Creset %ad %Cred|%Creset %s%C(cyan)%d %Cgreen(%cr) %Cblue[%an]%Creset\" --date=short | |
changes = log --pretty=format:\"%s\" | |
type = cat-file -t |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git checkout { your branch } | |
git checkout -b tmp | |
git checkout develop | |
git pull | |
git rebase develop { your branch } | |
{ complete all rebase steps } | |
git checkout develop | |
git merge --no-ff { your branch } | |
git push | |
git checkout { your branch } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
osascript -e 'tell application "iOS Simulator" to quit' | |
osascript -e 'tell application "Simulator" to quit' | |
xcrun simctl erase all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// If you want to create some common way to load objects from nibs, you will probably try something like that: | |
protocol NibLoadable: class { | |
static func fromNib() -> Self? | |
static func nibName() -> String | |
} | |
extension NibLoadable { | |
static func nibName() -> String { | |
return String(describing: Self.self) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
custom_rules: | |
quick_focus: | |
included: ".*.swift" | |
name: "Focus on tests" | |
regex: "^\s*f(it|context|describe)\s*\(" | |
match_kinds: | |
- identifier | |
message: "Focused tests should not be commited" | |
severity: warning |