Skip to content

Instantly share code, notes, and snippets.

View cvasilak's full-sized avatar

Christos Vasilakis cvasilak

View GitHub Profile
{"id":null,"firstName":null,"otp":null,"password":null,"email":null,"lastName":null,"uri":"otpauth://totp/john?secret=RLTKIYD2IPB6ETWZ"}{"id":null,"firstName":null,"otp":null,"password":null,"email":null,"lastName":null,"uri":"otpauth://totp/john?secret=RLTKIYD2IPB6ETWZ"}
{"id":null,"firstName":null,"otp":null,"password":null,"email":null,"lastName":null,"uri":"otpauth://totp/john?secret=4DC6QJDTCHNQPOXE"}
{"id":null,"firstName":null,"otp":null,"password":null,"email":null,"lastName":null,"uri":"otpauth://totp/john?secret=4DC6QJDTCHNQPOXE"}
@cvasilak
cvasilak / gist:4327302
Created December 18, 2012 11:39
iOS Query & Paging

Further, initial work has been done to support quering and paging of the data. Currently implemented in the Pipeline using the readWithFilter method, will allow you to specify your query (where clause) and paging (limit/offset) requirements, which will then be passed on your remote endpoints to process. Work is in progess, to support quering and paging on the local DataStore, exploiting some of the fine mechanisms that the iOS provides (e.g. NSPredicate) and of course provide easier abstractions for our users to work with.

Quering and Paging is going to play an important role in the next couple of releases. Currently, there is an ongoing discussion in the mailing list, so if there is correct time to get involved it is now! We would be more than happy to hear your ideas and suggest

@cvasilak
cvasilak / gist:4286866
Created December 14, 2012 16:53
AeroGear and OTP

AeroGear and OTP

If you happen to use online banking systems, certainly you will have come across small security devices that provide you with an extra password during your login process. That is, in addition to your standard username/password combination, you are asked to provide an extra password, the so called "One Time Password" (OTP). That has two effects a) the bank can verify that you are the actual person making the transaction because of the possession of this device that only you can have, the so called possession factor in the two-factor authentication system and b) prevents replay attacks cause the password is only valid for a limited amount of time. This generation of the OTP password can either be done using a hardware device (hardware token) as we described earlier or with the help of a mobile application running on a smartphone (softwar

// generate token
_secret = @"XXXXXXX";
NSData *secretData = [AGBase32 base32Decode:_secret];
AGTotp _totp = [[AGTotp alloc] initWithSecret:secretData];
NSString *otp = [_totp generateOTP];
@interface Tweet : NSObject
@property(nonatomic, readonly) NSString *idStr;
@property(nonatomic, readonly) NSString *tweetText;
@property(nonatomic, readonly) User *userOwner;
@end
---
@interface Tweet : NSObject
@property(nonatomic, readonly) NSString *idStr;
@property(nonatomic, readonly) NSString *tweetText;
@property(nonatomic, readonly) User *userOwner;
@end
#import <Foundation/Foundation.h>
@protocol AGEntity <NSObject>
@optional
-(NSDictionary*) mapping;
@end
@inteface Customer: NSOBject<AGEntity>
@cvasilak
cvasilak / gist:3851304
Created October 8, 2012 08:04 — forked from matzew/gist:3838816
FAQ or Wiki or ...
  • What is a pipeline ?

A pipeline represents a set of n connections to a server. The pipeline class offers some simple 'management' APIs to work with containing 'pipe' objects. Basically it allows you to add or remove new connections to the pipeline.

  • What is a pipe ?

A pipe represents one connection to a server. The pipe API is basically an abstraction layer for any server side connection, which all allows you to simply 'read' from, or 'write' to a server connection. However, technical details like RESTful APIs (e.g. HTTP PUT or HTTT GET) are not exposed on the pipeline and pipe APIs. In the future you can have different type of pipe objects (-> connections). The default (and CURRENTLY only supported) type is a REST connection.

Below is an example from our JavaScript lib:

@cvasilak
cvasilak / gist:643309
Created October 24, 2010 08:27
success output
casper:~ cvasilak$ which pkg-config
/usr/local/bin/pkg-config
casper:~ cvasilak$ brew install pango
Formula already installed: /usr/local/Cellar/pango/1.28.1
casper:~ cvasilak$ brew link pango
25 links created for /usr/local/Cellar/pango/1.28.1
casper:~ cvasilak$ brew install rrdtool