This file contains 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
# | |
# Reorder property attributes in one possible way | |
# | |
# @property (nullable, readonly, assign, nonatomic, getter=isReady) BOOL ready; | |
# | |
# 1. Move readonly to the BEGIN of attribute list | |
# 2. Move nullable to the BEGIN of attribute list | |
# 3. Move null_resettable to the BEGIN of attribute list | |
# 4. Move nonatomic to the END of attribute list | |
# 5. Move getter to the END of attribute list |
This file contains 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
#import <QuartzCore/QuartzCore.h> | |
#import "Bike.h" | |
@implementation Bike { | |
} | |
- (id)initWithFrame:(CGRect)frame { | |
self = [super initWithFrame:frame]; |
This file contains 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
/* | |
* fizzbuzz.cpp | |
* | |
* Created on: Apr 25, 2012 | |
* Author: Brian Geffon | |
* | |
* Modified on: May 25, 2016 | |
* Author: Anton Bukov | |
* | |
* fizzbuzz solved without looping or conditionals using only template recursion. |
This file contains 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
set -eu -o pipefail | |
function show_code { | |
while read ERROR_LOCATION; do | |
echo "$ERROR_LOCATION:: error: Missing imageset with name $1" | |
done < <(find "$PROJECT_NAME" -name '*.m' -print0 | xargs -0 grep -n -o -e "\[UIImage imageNamed:@\"$1\"\]" | cut -d ':' -f 1,2) | |
} | |
function show_img { | |
echo -n $(find "$PROJECT_NAME" -name "$1.imageset") |
This file contains 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
@interface AutolayoutTableView : UITableView | |
@end | |
@implementation AutolayoutTableView | |
- (void)layoutSubviews { | |
[super layoutSubviews]; | |
// Dynamic sizing for the header view |
This file contains 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
find ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins -name Info.plist -maxdepth 3 | xargs -I{} defaults write {} DVTPlugInCompatibilityUUIDs -array-add `defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID` |
This file contains 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
[statusBarBackground.edgesAnchor.withoutBottomAnchor constraintsEqualToConstant:UIEdgeInsetsZero].active = YES; | |
[statusBarBackground.heightAnchor constraintEqualToConstant:kStatusBarBackgroundHeight]; | |
[commentLabel.centerYAnchor constraintEqualToAnchor:commentLabel.superView].active = YES; | |
[commentLabel.leadingAnchor.withTrailingAnchor constraintsLessThanOrEqualToConstant:UIEdgeInsetsMake(0, kCommentLeading, 0, kCommentTrailing)].active = YES; |
This file contains 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
@[ | |
[statusBarBackground.edgesAnchor.withoutBottomAnchor constraintsEqualToConstant:UIEdgeInsetsZero], | |
[statusBarBackground.heightAnchor constraintEqualToConstant:kStatusBarBackgroundHeight], | |
].active = YES; | |
@[ | |
[commentLabel.centerYAnchor constraintEqualToAnchor:commentLabel.superView], | |
[commentLabel.leadingAnchor.withTrailingAnchor constraintsLessThanOrEqualToConstant:UIEdgeInsetsMake(0, kCommentLeading, 0, kCommentTrailing)], | |
].active = YES; |
This file contains 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
@[ | |
@[ | |
[statusBarBackground.edgesAnchor.withoutBottomAnchor constraintsEqualToConstant:UIEdgeInsetsZero], | |
[statusBarBackground.heightAnchor constraintEqualToConstant:kStatusBarBackgroundHeight], | |
], | |
@[ | |
[commentLabel.centerYAnchor constraintEqualToAnchor:commentLabel.superView], | |
[commentLabel.leadingAnchor.withTrailingAnchor constraintsLessThanOrEqualToConstant:UIEdgeInsetsMake(0, kCommentLeading, 0, kCommentTrailing)], | |
], |