Skip to content

Instantly share code, notes, and snippets.

@MaciejGad
MaciejGad / updateXcodePlugins.sh
Created July 1, 2015 09:30
update Xcode plugins
#!/bin/bash
xcodeUUID=`defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID`
echo $xcodeUUID
find ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins -name Info.plist -maxdepth 3 | xargs -I{} defaults write {} DVTPlugInCompatibilityUUIDs -array-add $xcodeUUID
// 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) {
#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;
}
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\" }'"
#import <UIKit/UIKit.h>
@interface ViewController : UITableViewController <UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) NSMutableArray *data;
@property (nonatomic, strong) NSMutableArray *sectionTitles;
@end
#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;