This file contains 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
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"REST URL PATH"]]; | |
NSData *imageData = UIImageJPEGRepresentation(image, 1.0); | |
[request setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData]; | |
[request setHTTPShouldHandleCookies:NO]; | |
[request setTimeoutInterval:60]; | |
[request setHTTPMethod:@"POST"]; | |
NSString *boundary = @"unique-consistent-string"; |
This file contains 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
{ | |
"id": 27, | |
"description": "Raviver la flamme, c est mettre du piment dans sa vie de couple. Savez vous le surprendre ? Faîtes le test !", | |
"urlKey": "/api/v1/fr/tests/27", | |
"title": "Savez-vous le surprendre?", | |
"target_sex": "", | |
"credits": 15, | |
"logo": "", | |
"pictureURL": "/images/img_atoutsSeduction.png", | |
"score_based": false, |
This file contains 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
{ | |
"id": 27, | |
"description": "Raviver la flamme, c est mettre du piment dans sa vie de couple. Savez vous le surprendre ? Faîtes le test !", | |
"urlKey": "/api/v1/fr/tests/27", | |
"title": "Savez-vous le surprendre?", | |
"target_sex": "", | |
"credits": 15, | |
"logo": "", | |
"pictureURL": "/images/img_atoutsSeduction.png", | |
"score_based": false, |
This file contains 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
- (void)decomposeFlightsPerHour { | |
self.decomposedFlights = [NSMutableDictionary dictionary]; | |
NSMutableArray *temp = [NSMutableArray array]; | |
NSString *currentHourPrefix = [[[self.flightList objectAtIndex:0] objectForKey:@"HP"] substringToIndex:2]; | |
NSString *dateHourPrefix = [[[self.flightList objectAtIndex:0] objectForKey:@"DATEVOL"] substringToIndex:10]; | |
NSString *newPrefix = [NSString stringWithFormat:@"%@_%@", dateHourPrefix, currentHourPrefix]; | |
for (NSDictionary *flightInfo in self.flightList) { |
This file contains 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 *)fetchPopularSearches { | |
__block NSMutableArray *result = [NSMutableArray array]; | |
NSString *searchQuery = [NSString stringWithFormat:@"url_to_flights_json"]; | |
NSURL *url = [[NSURL alloc] initWithString:searchQuery]; | |
NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url]; | |
AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request | |
success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) | |
{ |
This file contains 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
- (void)preparePushConfigurationParams { | |
NSMutableDictionary *finalParamsDict = [NSMutableDictionary dictionary]; | |
NSArray *temp = [self.selectedTeamsForNews arrayByAddingObjectsFromArray:self.selectedTeamsForPush]; | |
NSMutableDictionary *finalDict = [NSMutableDictionary dictionary]; | |
for (FMTeam *aTeam in temp) { | |
NSMutableDictionary *aDict = [NSMutableDictionary dictionary]; | |
BOOL configure_for_push = [self.selectedTeamsForPush containsObject:aTeam]; | |
BOOL configure_for_news = [self.selectedTeamsForNews containsObject:aTeam]; | |
[aDict setObject:[NSNumber numberWithInt:aTeam.fm_team_id] forKey:@"fm_team_id"]; |
This file contains 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
class Api::V1::SessionsController < Devise::SessionsController | |
prepend_before_filter :require_no_authentication, :only => [:create] | |
skip_before_filter :verify_authenticity_token, :if => Proc.new { |c| c.request.format == 'application/json' } | |
before_filter :validate_auth_token, :except => :create | |
include Devise::Controllers::Helpers | |
include ApiHelper | |
respond_to :json | |
def create | |
resource = User.find_for_database_authentication(:email => params[:user][:email]) |
This file contains 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
// Page init code is at the bottom | |
var Map = (function(map, $){ | |
var exports = map || {}; | |
var geo = new google.maps.Geocoder(), | |
geocode = { | |
address: [ config.project_location.street, | |
config.project_location.city, | |
config.project_location.country].join(", ") |
NewerOlder