Skip to content

Instantly share code, notes, and snippets.

View hugo53's full-sized avatar
🏆
On new thing

Hoang Nguyen hugo53

🏆
On new thing
View GitHub Profile
@hugo53
hugo53 / vi.md
Last active August 29, 2015 13:57
Hugo Nguyen

Hi,

I'm Hugo, a Cu-liii at YLLabs.

Now I'm working as iOS Engineer in our private business.

Please check out our product, YLNews.

I'm also very keen on Hacker News and read tech/business articles.

#########################
# .gitignore file for Xcode4 / OS X Source projects
#
# Version 2.0
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
# 2013 updates:
# - fixed the broken "save personal Schemes"
#
# NB: if you are storing "built" products, this WILL NOT WORK,
@hugo53
hugo53 / SVN.md
Created March 26, 2014 04:22
SVN command

Discard local change

svn revert -R . >>> for current dir

Update latest from svn server

svn update --force
@hugo53
hugo53 / vicommand.md
Created May 8, 2014 11:12
vi commands

Search and count the result

:%s/pattern//gn
:%s/Rotate//gn to search for 'Rotate'
@hugo53
hugo53 / gist:6598af5190804bd727e6
Created November 24, 2014 00:04
Get view controller of a view
UIViewController *viewController;
for (UIView* next = [self superview]; next; next = next.superview) {
UIResponder* nextResponder = [next nextResponder];
if ([nextResponder isKindOfClass:[UIViewController class]]) {
viewController = (UIViewController*)nextResponder;
}
}
return viewController;
@hugo53
hugo53 / disableCaseSensitive.md
Last active August 29, 2015 14:11
Disable case sensitive auto complete on Terminal (Mac OSX)

$ echo "set completion-ignore-case On" >> ~/.inputrc

$ sudo echo "set completion-ignore-case On" >> ~/.inputrc

@hugo53
hugo53 / “AFNetworking.h” file not found in .pch file.md
Created December 23, 2014 04:16
“AFNetworking.h” file not found in .pch file
   _resultLbl = [[UILabel alloc] init];
    _resultLbl.numberOfLines = 1;
    _resultLbl.textAlignment = NSTextAlignmentRight;
    _resultLbl.font = [UIFont systemFontOfSize:35];
    _resultLbl.text = @"0";
    _resultLbl.textColor = [UIColor whiteColor];
    _resultLbl.adjustsFontSizeToFitWidth = YES;
    _resultLbl.minimumScaleFactor = 0.4;
@hugo53
hugo53 / gist:fc447afc885518bf5470
Created June 29, 2015 15:40
2-letter countries code in the world.md
NSMutableArray *africa = [NSMutableArray arrayWithArray:@[@"DZ",
@"AO",
@"BJ",
@"BW",
@"BF",
@"BI",
@"CM",
@"CV",
@"CF",
@"KM",
UIButton *backButton = [[UIButton alloc] init];
[backButton addTarget:self action:@selector(backButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
backButton.titleLabel.font = [UIFont fontWithName:@"ivvi-app-thumbnav-icons" size:34];
[backButton setTitle:@"\ue820" forState:UIControlStateNormal];
[backButton setTitleColor:[UIColor ivviNavigationTitle] forState:UIControlStateNormal];
CGFloat leftInset = [self.navigationController.navigationBar respondsToSelector:@selector(layoutMargins)] ? 14 : 10;
backButton.frame = CGRectMake(0, 0.0f, 44.0f, 44.0f);
backButton.contentEdgeInsets = UIEdgeInsetsMake(0, -leftInset, 0, 20);