Skip to content

Instantly share code, notes, and snippets.

View corinnekrych's full-sized avatar
🐝

corinnekrych corinnekrych

🐝
View GitHub Profile
@corinnekrych
corinnekrych / gist:8068425
Last active March 12, 2017 22:03
mdevcon.com c4p

With over 15 years of experience in development, Corinne is addicted to code and can’t go very far from it. She traveled from C++ to Java, J2EE and naturally made her path to mobile apps by joining Red Hat AeroGear team. Being an Agile coach and practitioner, she thinks code is craft and collaboration is key to success. Chatting about the latest tech trends on twitter (@corinnekrych): female geek – what do you expect? – she’s always curious to discover languages and frameworks.

Easy enterprise iOS app

Type: Tools in Action

Abstract:

NSString* readGoogleDriveURL2 = @"https://www.googleapis.com/drive/v2/files";
NSString *url = [NSString stringWithFormat:@"%@?access_token=%@", readGoogleDriveURL2, object];
AFHTTPClient* restClient = [[AFHTTPClient alloc] initWithBaseURL:[NSURL URLWithString:readGoogleDriveURL2]];
[restClient postPath:url parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"Invoking successblock for List Google DRIVE....");
POST /drive/v2/files?access_token=ya29.1.AADtN_VVzuthY6mCLmK8vNTnhS_7lwMOnT0R8MMrwTRSck2MVURZuIGGQVz6mUmbvZQwbQ HTTP/1.1
Host: www.googleapis.com
Accept-Encoding: gzip, deflate
Accept: */*
Content-Length: 0
Connection: keep-alive
Accept-Language: en;q=1, fr;q=0.9, de;q=0.8, ja;q=0.7, nl;q=0.6, it;q=0.5
User-Agent: Shoot/1.0 (iPad; iOS 7.0.4; Scale/2.00)
-----
POST /drive/v2/files HTTP/1.1
NSData *imageData = UIImageJPEGRepresentation(self.imageView.image, 0.2);
AGFileDataPart *dataPart2 = [[AGFileDataPart alloc] initWithFileData:imageData
name:@"image"
fileName:@"image.jpeg" mimeType:@"image/jpeg"];
AGFileDataPart *dataPart1 = [[AGFileDataPart alloc] initWithFileData:[NSKeyedArchiver archivedDataWithRootObject:@{@"title":@"ttt"}] name:@"image" fileName:@"image.jpeg" mimeType:@"image/jpeg"];
// set up payload
NSDictionary *dict = @{@"data1:": dataPart1, @"data2:": dataPart2, @"uploadType":@"multipart"};
[pipe save:dict success:^(id responseObject) {
NSLog(@"Successfully uploaded!");
@corinnekrych
corinnekrych / gist:8397428
Last active January 3, 2016 02:39
Bio francais
Corinne Krych
Consultant freelance depuis … quand on aime, on ne compte pas! Et pour sur, je ne m'éloigne jamais trop du code.
Curieuse et trendy (développeur au féminin), le mobile c'est mon nouveau terrain de jeu. Mobile web app, Hybrid et plus récemment des applications natives. Depuis Mai, j'ai rejoins Red Hat (et Sébastien) au sein de l'équipe AeroGear. Polyglot par essence, une forte addiction au clean code, je m'amuse en mon temps libre (et avec mes copains geeks) à torturer les langages de la JVM pour définir le DSL le plus lean. Par dessus tout, j'aime partager, échanger. C'est dans cet esprit que je suis co-fondateur du RivieraGUG, membre actif du JSSophia. N’hésitez pas à venir chatter avec moi @corinnekrych
-----
Dev for over 15 years (when you like it you don't really count), I never go too far from coding.
Open minded and curious, I like to try new stuff; Those days, mobile is my new playground. Mobile web app, Hybrid and more recently native apps. Since May, I've joined Read Hat and work wit
@corinnekrych
corinnekrych / gist:8398071
Last active January 3, 2016 02:49
Greach 2014 call for paper

Hybrid Mobile App in minutes, not days: Fast and furious II.

You want to develop a mobile web app. You app needs to connect to a Grails backend. You don't know where to start? This session is tailored for you: live coding will show you where to start from scaffolding a web application with modern HTML5 Front End, using OAuth2 to authenticate and authorize to packaging your app into a native shell.

@corinnekrych
corinnekrych / gist:8472700
Last active January 3, 2016 13:59
Devoxx FR
Crash course sur iOS et Objective-C pour developpeur Java
====
Super fier: ta mobile app vient d'être publiée sur Google Store! Seulement voila ton boss veut la version native iOS...
Ca veut dire développer avec Objective-C! Tu trouves la syntaxe barbare? Relax, en utilisant les templates et le storyboard tu construis ta UI très rapidement. Ton appli doit etre connectée à un backend Cloud? Accéder aux resources de tes médias sociaux préférés? Sauver et encrypter tes données sensibles? Gérer le mode offline et la syncho. Pas de problème, toute cette plomberie est transparente en utilisant les librairies iOS d'AeroGear.
[tabs]
[names="Java,iOS,JavaScript"]
[source,java]
----
* public class Car {
* @RecordId
* public Long id;
* public String make;
* public String model;
@corinnekrych
corinnekrych / gist:8744777
Last active November 27, 2015 06:04
Let's practise OAuth2 dance !

You want to build a cool app to share your photos on Twitter, Googgle+, Facebook... Tackle all the 'cool' social networks. First thing you need to do is: authenticate and authorize your app for each providers.

Good news is: there is a common protocol for that. Its little name is 'OAuth2'. Each provider comes with an iOS sdk to ease the OAuth2 dance, but of course, each has its own API.

Ouch! And what you really want is use the same API for all them. Let's see how you can implement OAuth2 protocol and provide a common API across providers. Much easier than his elder brother OAuth, we will dive into OAuth2 protocol and see the challenges of implementing it from a native app perspective.

// AGSyncPipe protocol
@protocol AGSyncPipe
// to dicuss: conflict callback could also have baseObject for 3 ways merge options
-(void) save:(AGSyncMetaData*) object
success:(void (^)(id responseObject))success
failure:(void (^)(NSError *error))failure
conflict:(void (^)(NSError *error, AGSyncMetaData* fromObject, AGSyncMetaData* toObject))conflict;
-(void) read:(void (^)(id responseObject))success
failure:(void (^)(NSError *error))failure;