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
######################### | |
# .gitignore file for Xcode5 | |
# | |
# NB: if you are storing "built" products, this WILL NOT WORK, | |
# and you should use a different .gitignore (or none at all) | |
# This file is for SOURCE projects, where there are many extra | |
# files that we want to exclude | |
# | |
# For updates, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects | |
# and https://gist.github.com/adamgit/3786883 |
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
ps auxw | grep Coff | |
cp ~/Downloads/sqlite.db ~/Library/Application\ Support/iPhone\ Simulator/7.1/Applications/9CD889F1-2335-481F-8C34-6E4B7E33F571/Documents/sqlite.db |
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
} else if ([choice isEqualToString:@"Feedback"]) { | |
if ([MFMailComposeViewController canSendMail]) | |
{ | |
MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc] init]; | |
mailer.mailComposeDelegate = self; | |
[mailer setSubject:@"[Hopp2IT] Feedback"]; | |
NSString * version = [[NSBundle mainBundle] objectForInfoDictionaryKey: @"CFBundleShortVersionString"]; | |
NSString *device = ([HPManager isiPhone5]) ? @"iPhone5" : @"<=iPhone4"; | |
NSString *messageBody = [NSString stringWithFormat:@"\n\n~~~~~~~~~~~~~~\nPlatform: iOS\nDevice: %@\nVersion: %@\n",device,version]; | |
[mailer setMessageBody:messageBody isHTML:NO]; |
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
var allowCrossDomain = function(req, res, next) { | |
res.header('Access-Control-Allow-Origin', '*'); | |
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE'); | |
res.header('Access-Control-Allow-Headers', 'Content-Type, Authorization'); | |
if ('OPTIONS' == req.method) { | |
res.send(200); | |
} | |
else { | |
next(); |
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
// http://www.objc.io/issue-9/unicode.html | |
NSString *s = @"\u00E9"; // é | |
NSString *t = @"e\u0301"; // e + ´ | |
BOOL isEqual = [s isEqualToString:t]; | |
NSLog(@"%@ is %@ to %@", s, isEqual ? @"equal" : @"not equal", t); | |
// => é is not equal to é | |
// Normalizing to form C | |
NSString *sNorm = [s precomposedStringWithCanonicalMapping]; | |
NSString *tNorm = [t precomposedStringWithCanonicalMapping]; |
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
NSUInteger realLength = [s lengthOfBytesUsingEncoding:NSUTF32StringEncoding] / 4; | |
NSLog(@"The real length of %@ is %lu", s, realLength); | |
// => The real length of 🌍 is 1 |
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
NSString *s = @"The weather on \U0001F30D is \U0001F31E today."; | |
// The weather on 🌍 is 🌞 today. | |
NSRange fullRange = NSMakeRange(0, [s length]); | |
[s enumerateSubstringsInRange:fullRange | |
options:NSStringEnumerationByComposedCharacterSequences | |
usingBlock:^(NSString *substring, NSRange substringRange, | |
NSRange enclosingRange, BOOL *stop) | |
{ | |
NSLog(@"%@ %@", substring, NSStringFromRange(substringRange)); | |
}]; |
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
- (void)textFieldDidBeginEditing:(UITextField *)textField | |
{ | |
int remainder = MAX_CHARACTER_COUNT - textField.text.length; | |
self.counterLabel.text = [NSString stringWithFormat:@"%d", remainder]; | |
if (textField == self.activityNameTextField) { | |
self.counterLabel.yOrigin = self.activityNameContainerView.yOrigin; | |
[self closePlaceTableView]; | |
} else { |
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 HPGroupSelectViewController : UIViewController <UITableViewDataSource, UITableViewDelegate> | |
@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
if ((![CLLocationManager locationServicesEnabled]) | |
|| ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusRestricted) | |
|| ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusDenied)) { | |
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error", nil) message:NSLocalizedString(@"Location services must be enabled in Settings.", nil) delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; | |
[alertView show]; |