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
<?php | |
//To Execute this this from Mac Terminal type php thisFilename.php | |
$url = 'https://fcm.googleapis.com/fcm/send'; | |
$fields = array ( | |
'to' => 'fq5fI_wcXNY:APA91bGpR-qCYW01wNJ8pnp1ftfgR3DHqPk3ViXDqTYrq-p7MUhry9cPcpXEl7z4GFHGUPcTduww656Rks8cOpSZR-FjrseDX4S-eGdzGaBEqI46KWF8ZJmJpegbf3tzVZwILmnf64aU',//Replace with FIRInstanceID.instanceID().token() this you can get in Appdelegate, note this is NOT token received in didRegisterForRemoteNotificationsWithDeviceToken | |
'notification' => array ( | |
"body" => "message", |
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
# To get this to work with a Xcode 6 Cocoa Touch Framework, create Framework | |
# Then create a new Aggregate Target. Throw this script into a Build Script Phrase on the Aggregate | |
###################### | |
# Options | |
###################### | |
REVEAL_ARCHIVE_IN_FINDER=true |
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
//Print on terminal after 3 seconds | |
ping -i 3 google.com | while read pong; do echo "$(date): $pong"; done | |
//Pring on terminal after 3 seconds and print log in file | |
ping -i 3 google.com | while read pong; do echo "$(date): $pong"; done| tee /Users/Aditya/Desktop/TerminalLogs/Saturday_30_July.txt |
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
for (NSString* family in [UIFont familyNames]) | |
{ | |
NSLog(@"%@", family); | |
for (NSString* name in [UIFont fontNamesForFamilyName: family]) | |
{ | |
NSLog(@"Actual font name : %@", name); | |
} |
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
-(NSArray*) dataSourceForSearchString:(NSString*) searchedText | |
{ | |
NSString *strTrimmedSearchText = [searchedText stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; | |
NSArray *array = [strTrimmedSearchText componentsSeparatedByString:@" "]; | |
NSPredicate *predicate = nil; | |
/* | |
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
- (BOOL) validateDateWithCurrentDate | |
{ | |
NSDateFormatter *dateFormatter = [NSDateFormatter new]; | |
[dateFormatter setDateFormat:@"MM/dd/yyyy"]; | |
[dateFormatter setTimeZone:[NSTimeZone timeZoneWithName:@"GMT"]];//Set timezone to match with [NSDate date] format | |
_chosenDate = [dateFormatter dateFromString:_labelDateOfBirthSeleced.text]; | |
NSComparisonResult dateComparison = [[NSCalendar currentCalendar] compareDate:[NSDate date] | |
toDate:_chosenDate | |
toUnitGranularity:NSCalendarUnitDay];//dont compare time factor |
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
#pragma mark - Keyboard handling | |
-(void)registerForKeyBoardNotifications | |
{ | |
// register for keyboard notifications | |
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyBoardWasShown:) name:UIKeyboardWillShowNotification object:nil]; | |
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyBoardWillHide:) name:UIKeyboardWillHideNotification object:nil]; | |
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
Requirement iOS 8 and above | |
//1. Dyanamic table cells | |
//Just set following two lines in view did load | |
_tableView.estimatedRowHeight = someHeightConstant;//provide any value it gets set as default if no constraints are set | |
_tableView.rowHeight = UITableViewAutomaticDimension; | |
//2. Static table cells |
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
Split: | |
split -b YOUR_EXPECTED_SIZES YOUR_FILE_NAME PATTERN_NAME_AS_OUTPUT | |
Join: | |
cat SPITED_FILES_AS_LIST > NEW_FILE | |
Example: | |
Split: | |
split -b 1024m "XCode_7.2.dmg" "XCode_7.2.dmg." |
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
/* Input Data sample | |
SWSearchContact *contactModel = [[SWSearchContact alloc] init]; | |
contactModel.arrPhoneNumbers = [arrPhoneNumbers copy]; | |
contactModel.strFirstName = firstName ? firstName : @""; | |
contactModel.strMiddleName = middleName ? middleName : @""; | |
contactModel.strLastName = lastName ? lastName : @""; | |
[_arrMutContacts addObject:contactModel]; |
NewerOlder