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
alias longestFiles='find . -name \*.m -not -path "./Pods/*" -exec wc -l {} \; | sort | tail' | |
alias avgFilesLong="find . -name \*.m -not -path './Pods/*' -exec wc -l {} \; | awk '{ total += \$1; count++} END { print total/count }'" | |
alias toLongFiles="find . -name \*.m -not -path './Pods/*' -exec wc -l {} \; | sort | awk 'BEGIN{ count = 0; } { if (\$1 > 300){ print \$0; count++}} END { print \" \" count \" files long over 300 lines\" }'" |
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
#contentArea { | |
width:850px!important; | |
} | |
._4-u2,._5x16 ._5inf::after,._6l-:after, ._4_w3::after, ._5va1, .timelineUnitContainer, .timelineReportContainer, ._4lh .fbTimelineCapsule .timelineUnitContainer, ._4lh ._1xz, ._1xw:hover ._1xz, ._4lh ._1xw, .UFIReplyList .UFIRow, ._5vsj .UFIReplyList .UFIComponent.UFILastComponent:after, ._5vsj .UFIReplyList .UFIComponent.UFIFirstComponent:after { | |
border:0!important; | |
border-left: none!important; | |
border-right:none!important; | |
-webkit-box-shadow: none!important; | |
} |
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
// returns a MKCoordinateRegion that encompasses an array of MKAnnotations | |
- (MKCoordinateRegion)regionForAnnotations:(NSArray *)annotations { | |
CLLocationDegrees minLat = 90.0; | |
CLLocationDegrees maxLat = -90.0; | |
CLLocationDegrees minLon = 180.0; | |
CLLocationDegrees maxLon = -180.0; | |
for (id <MKAnnotation> annotation in annotations) { |
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
if [ "$CONFIGURATION" = "Ad hoc" ] || [ "$CONFIGURATION" = "Release" ]; then | |
echo "Bumping build number..." | |
plist=${PROJECT_DIR}/${INFOPLIST_FILE} | |
buildnum=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${plist}") | |
if [[ "${buildnum}" == "" ]]; then | |
echo "No build number in $plist" | |
exit 2 | |
fi |
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 <Foundation/Foundation.h> | |
@interface NSMutableURLRequest (KDJBasicAuthentication) | |
// Sets the "Authorization" HTTP header to a basic authentication value | |
// with Base64-encoded username and password. This overwrites any existing | |
// value for this header. | |
- (void)setAuthorizationHeaderWithUsername:(NSString *)username | |
password:(NSString *)password; |
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 <UIKit/UIKit.h> | |
@interface ViewController : UITableViewController <UITableViewDelegate, UITableViewDataSource> | |
@property (nonatomic, strong) NSMutableArray *data; | |
@property (nonatomic, strong) NSMutableArray *sectionTitles; | |
@end |
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
//remember to intall AFNetworking https://github.com/AFNetworking/AFNetworking#installation-with-cocoapods | |
//and add import : | |
//#import "UIImageView+AFNetworking.h" | |
- (void)setImageFromDictionary:(NSDictionary *)dic2 { | |
NSString *path = dic2[@"safe_value"]; | |
if (![path isKindOfClass:[NSString class]]) { | |
return; | |
} | |
NSURL *imageUrl = [NSURL URLWithString:path]; |
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 Foundation | |
import UIKit | |
enum NibBaseError:Error { | |
case badClassName | |
case noNibFile | |
case noStoryboard | |
} | |
class NibBaseViewController: UIViewController, IsNibBaseViewController { |
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
extension UITabBarController { | |
func set(visible: Bool, animated: Bool, completion: ((Bool)->Void)? = nil ) { | |
guard isVisible() != visible else { | |
completion?(true) | |
return | |
} | |
let offsetY = tabBar.frame.size.height |
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
#!/bin/bash | |
info="Info.plist" | |
plistBuddy=/usr/libexec/PlistBuddy | |
version=`$plistBuddy -c "print CFBundleVersion" "$info"` | |
echo "Current version: $version" | |
((version++)) | |
echo "New version: $version" | |
$plistBuddy -c "set CFBundleVersion $version" "$info" |
OlderNewer