This file contains hidden or 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
| def active | |
| inactive_at.nil? | |
| end |
This file contains hidden or 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
| def generate_site_code | |
| # Remove all non letters characters | |
| site_name = name.gsub(/[^a-zA-Z]/, '') | |
| # Make sure the site name is at least 5 characters | |
| site_name += Array(('a'..'z')).shuffle[0, (5 - site_name.length)].join if site_name.length < 5 | |
| # The site code is made up of the country and state code plus the first 5 characters of the site name | |
| code = country.code[0..1] + (city.state.code? ? city.state.code[0..2] : country.description[0..2]) + site_name[0..4] | |
| self.code = code.upcase |
This file contains hidden or 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
| $ -> | |
| $(".app_url").data("timeout", null).keyup -> | |
| url = $(this).val() | |
| clearTimeout $(this).data("timeout") | |
| $(this).data "timeout", setTimeout(checkForValidUrl(url), 10000) |
This file contains hidden or 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)saveUser { | |
| AppDelegate *delegate = (AppDelegate *) [[UIApplication sharedApplication] delegate]; | |
| [[delegate facebook] requestWithGraphPath:@"me" andDelegate:self]; | |
| } |
This file contains hidden or 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
| dataPages = [[NSArray alloc] initWithObjects: | |
| [NSDictionary dictionaryWithObjectsAndKeys: | |
| @"http://dribbble.com/system/users/4870/screenshots/203015/bacardi-mojito.jpg?1309590925", @"1", | |
| @"http://dribbble.com/system/users/19849/screenshots/203160/mc-donalds-character.png?1309591886", @"1_full", | |
| @"http://dribbble.com/system/users/4605/screenshots/202970/for_dribbble.png?1309582909", @"2", | |
| @"http://dribbble.com/system/users/19849/screenshots/203160/mc-donalds-character.png?1309591886", @"2_full", | |
| nil], | |
| [NSDictionary dictionaryWithObjectsAndKeys: | |
| @"http://dribbble.com/system/users/3460/screenshots/203157/avatar.png?1309591592", @"1", | |
| @"http://dribbble.com/system/users/4870/screenshots/203015/bacardi-mojito.jpg?1309590925", @"2", |
This file contains hidden or 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)setPageIndex:(NSInteger)newPageIndex | |
| { | |
| pageIndex = newPageIndex; | |
| if (pageIndex >= 0 && pageIndex < [[DataSource sharedDataSource] numDataPages]) | |
| { | |
| // NSArray *pageData = | |
| // [[DataSource sharedDataSource] dataForPage:pageIndex]; | |
| // | |
| // image_one.image = [pageData objectAtIndex:0]; |
This file contains hidden or 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)setPageIndex:(NSInteger)newPageIndex | |
| { | |
| pageIndex = newPageIndex; | |
| if (pageIndex >= 0 && pageIndex < [[DataSource sharedDataSource] numDataPages]) | |
| { | |
| // NSArray *pageData = | |
| // [[DataSource sharedDataSource] dataForPage:pageIndex]; | |
| // | |
| // image_one.image = [pageData objectAtIndex:0]; |
This file contains hidden or 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
| #import "DataSource.h" | |
| #import "SynthesizeSingleton.h" | |
| @implementation DataSource | |
| SYNTHESIZE_SINGLETON_FOR_CLASS(DataSource); | |
| // | |
| // init | |
| // |
This file contains hidden or 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
| dataPages = [[NSArray alloc] initWithObjects: | |
| [UIImage imageNamed:@"image1.png"], | |
| [UIImage imageNamed:@"image2.png"], | |
| nil]; |
This file contains hidden or 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
| #import "DataSource.h" | |
| #import "SynthesizeSingleton.h" | |
| @implementation DataSource | |
| SYNTHESIZE_SINGLETON_FOR_CLASS(DataSource); | |
| // | |
| // init | |
| // |