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
defaultFont = [UIFont fontWithName:@"Bariol" size:14.0]; | |
for(UIView *aView in [[self view] subviews]){ | |
if([aView isKindOfClass:[UILabel class]]){ | |
[((UILabel*)aView) setFont:defaultFont]; | |
} | |
} |
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
source 'https://rubygems.org' | |
gem 'rails', '3.2.8' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
gem 'sqlite3' | |
gem 'mysql2' | |
gem 'jquery-rails' |
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
@implementation CustomViewFactory | |
+(CustomView*)newCustomView:(NSString*)lang{ | |
NSArray *nibs = [[NSBundle mainBundle] loadNibNamed:@"CustomView" owner:self options:nil]; | |
CustopmView *customView; | |
for(UIView *view in nibs){ | |
if([view isKindOfClass:[CustomView class]]){ | |
customView = (CustomView*)view; |
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 *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]]; | |
NSArray *fontNames; | |
NSInteger indFamily, indFont; | |
for (indFamily=0; indFamily<[familyNames count]; ++indFamily) | |
{ | |
NSLog(@"Family name: %@", [familyNames objectAtIndex:indFamily]); | |
fontNames = [[NSArray alloc] initWithArray: | |
[UIFont fontNamesForFamilyName: | |
[familyNames objectAtIndex:indFamily]]]; | |
for (indFont=0; indFont<[fontNames count]; ++indFont) |
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) request{ | |
NSString *targetUrlString = @"url"; | |
NSURL *targetUrl = [NSURL URLWithString:targetUrlString]; | |
NSData *data = [NSData dataWithContentsOfURL:targetUrl]; | |
[self performSelectorInBackground:@selector(callback:) withObject:data]; | |
} | |
-(void) callBack:(NSData*)respondedData{ | |
NSError *error; | |
NSDictionary *dataDic = [NSJSONSerialization |
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
NSUserDefaults *userPreference = [NSUserDefaults standardUserDefaults]; | |
[userPreference setValue:user_info forKey:@"key"]; | |
[userPreference removeObjectForKey:@"key"] | |
[userPreference synchronize];] |
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
UIStoryboard *storyboard = self.storyboard; | |
MyViewController *view = [storyboard instantiateViewControllerWithIdentifier:@"MyViewController"]; | |
self.view.window.rootViewController = view; |
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
before do | |
User.stub(:where) do |like_query, bind_param| | |
case bind_param | |
when 'Bob%' then [bob] | |
when 'Jane%' then [jane] | |
else [] | |
end | |
end | |
end |
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 UserParser | |
attr_reader :mentioned_users | |
def mention_users | |
@mentioned_users ||= <some processing> | |
end | |
end |
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
test |