Skip to content

Instantly share code, notes, and snippets.

@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;
@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-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-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-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-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;
}
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)
Relational databases have been a successful technology for twenty years providing
- persistence
- concurrency control (Multiple apps and multiple users access the DB at the same time)
- integration mechanism (This is what prevented object oriented DBs to flourish)
Drawbacks of Relational DBs
- Impedance mismatch (In-memory(object) model of an application is different from (relational) model on disk).
That's why there are ORM frameworks which lead to loss of performance
- They are not designed to run efficiently on clusters
@neerajgoel82
neerajgoel82 / whitepaper--big-data-trends-2017
Created February 14, 2017 19:26
Properties of Data Platform
@neerajgoel82
neerajgoel82 / books--the-inevitable
Last active June 16, 2021 15:02
This is the gist of the book "The Inevitable" by Kevin Kelly
We have seen technology evolve at a rapid pace in last 3 decades. From a point where computers were accessible to few to a world where they
are everywhere and connected. Internet moving from a point of rarity to ubiquity. This book by Kevin Kelly describes a dozen of inevitable
technological forces that have governed these changes and will continue to shape the next 30 years. He has captured their change into 12
verbs, such as accessing, tracking, and sharing. To be more accurate, these are not just verbs, but present participles, the grammatical
form that conveys continuous action. These forces are accelerating actions. Essentially these are getting amplified as we are changing
as a society. These forces are Becoming, Cognifying, Flowing, Screening, Accessing, Sharing, Filtering, Remixing, Interacting, Tracking,
Questioning, and then Beginning.
Before we move to the actual forces, we should have a note around the change itself. So, here it is.
----------------------------------------------------------