Skip to content

Instantly share code, notes, and snippets.

What is a habit?
----------------
Cognitive psychologists define habits as “automatic behaviors triggered by situational cues”: things we do with little or no
conscious thought. You can also say, A habit is when not doing an action causes a bit of pain.
Why it is important to create habits?
-------------------------------------
- Lower customer retention cost( Because habits mean returning users without external triggers. Essentially users come back without spending further money)
- Higher CLTV (Because customers stay with your product longer)
- Greater Pricing Flexibility (Because people would not like to leave the product because of price)
@neerajgoel82
neerajgoel82 / programming--ios-sqlite
Last active February 6, 2017 14:02
This is the gist of using sqlite with ios app
FailedBankInfo.h
----------------
@interface FailedBankInfo : NSObject {
int _uniqueId;
NSString *_name;
NSString *_city;
NSString *_state;
}
@neerajgoel82
neerajgoel82 / programming--ios-addressbook
Last active February 6, 2017 14:03
This is the gist of using ios address book api
- (void)addPetToContacts: (UIButton *) petButton{
NSString *petFirstName;
NSString *petLastName;
NSString *petPhoneNumber;
NSData *petImageData;
if (petButton.tag == 1){
petFirstName = @"Cheesy";
petLastName = @"Cat";
petPhoneNumber = @"2015552398";
petImageData = UIImageJPEGRepresentation([UIImage imageNamed:@"contact_Cheesy.jpg"], 0.7f);
@neerajgoel82
neerajgoel82 / programming--ios-alert
Last active February 6, 2017 14:03
iOS alert usage
UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Alert !!!" message:@"This message should pop us as soon as the app loads" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
[alert show];
@neerajgoel82
neerajgoel82 / programming--ios-NSFetchedResultsController
Last active February 6, 2017 14:04
This is the gist of using NSFetchedResultsController
- (NSFetchedResultsController *)fetchedResultsController {
if (_fetchedResultsController != nil) {
return _fetchedResultsController;
}
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription
entityForName:@"FailedBankInfo" inManagedObjectContext:managedObjectContext];
[fetchRequest setEntity:entity];
@neerajgoel82
neerajgoel82 / programming--ios-restkit
Last active February 6, 2017 14:04
This is the gist of using RestKit with iOS app
Venue.h
-------
@class Location;
@class Stats ;
@interface Venue : NSObject
@property (nonatomic, strong) NSString *name;
@property (nonatomic, strong) Location *location;
@property (nonatomic, strong) Stats *stats;
@neerajgoel82
neerajgoel82 / programming--ios-coredata
Last active February 6, 2017 14:03
This is the gist of using CoreData in iOS
FailedBankInfo.h
-----------------
#import <CoreData/CoreData.h>
@class FailedBankDetails;
@interface FailedBankInfo : NSManagedObject
@property (nonatomic, retain) NSString * name;
@property (nonatomic, retain) NSString * city;