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
// in invite.js module: | |
exports.inviteUser = function(creatingUser,email,tempPass,response) | |
{ | |
"use strict"; | |
if (!tempPass) { | |
tempPass = genRandomPass(); | |
} | |
var user = new Parse.User(); | |
user.set ("username", email); |
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
/// Observes a run loop to detect any stalling or blocking that occurs. | |
/// | |
/// This class is thread-safe. | |
@interface GHRunLoopWatchdog : NSObject | |
/// Initializes the receiver to watch the specified run loop, using a default | |
/// stalling threshold. | |
- (id)initWithRunLoop:(CFRunLoopRef)runLoop; | |
/// Initializes the receiver to detect when the specified run loop blocks for |
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
- (NSString *)normalizeString:(NSString *)string | |
{ | |
NSString *normalizedString = [[string copy] stringByStandardizingPath]; // copy to keep thread-safe; | |
if ([normalizedString hasPrefix:@".."]) { | |
normalizedString = [normalizedString substringFromIndex:2]; | |
} | |
if ([normalizedString containsString:@"/../"]) { | |
NSArray *components = [normalizedString componentsSeparatedByString:@"/../"]; | |
NSMutableArray *tempComponents = [components mutableCopy]; |
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
@implementation | |
/*...*/ | |
- (void)toggleFavorite:(BOOL)isFavorite | |
{ | |
PFUser *user = [PFUser currentUser]; | |
if (!user) { | |
return; | |
} |
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
#import <Foundation/Foundation.h> | |
#ifdef DEBUG | |
#define NSLog(args...) PXPLog(__FILE__,__LINE__,__PRETTY_FUNCTION__,args); | |
#else | |
#define NSLog(...) | |
#endif | |
void PXPLog(const char *file, int lineNumber, const char *functionName, NSString *format, ...); |
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
+ (NSString *)stringByReplacingSnakeCaseWithCamelCase:(NSString *)string | |
{ | |
NSArray *components = [string componentsSeparatedByString:@"_"]; | |
NSMutableString *camelCaseString = [NSMutableString string]; | |
[components enumerateObjectsUsingBlock:^(NSString *component, NSUInteger idx, BOOL *stop) { | |
[camelCaseString appendString:(idx == 0 ? component : [component capitalizedString])]; | |
if (idx > 0) { | |
[camelCaseString appendString:[component capitalizedString]]; | |
} else { | |
[camelCaseString appendString:component]; |
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
// | |
// ArrayExtensions.swift | |
// MyDailyGrind | |
// | |
// Created by Paris Pinkney on 7/8/14. | |
// Copyright (c) 2014 PXPGraphics. All rights reserved. | |
// | |
import Foundation |
NewerOlder