Skip to content

Instantly share code, notes, and snippets.

View ThinhPhan's full-sized avatar
🎯
Focusing

Thinh Phan ThinhPhan

🎯
Focusing
View GitHub Profile
@ThinhPhan
ThinhPhan / .gitignore-full-description
Last active August 29, 2015 14:09 — forked from adamgit/.gitignore
Xcode .gitignore file with full description.
#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.3
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
@ThinhPhan
ThinhPhan / UIColor+HexString.h
Created December 18, 2014 09:54
Objective-c UIColor category get color from hex string.
//
// UIColor+HexString.h
// DemoMapviewScrollView
//
// Created by ThinhPhan on 12/18/14.
// Copyright (c) 2014 Gennova. All rights reserved.
//
#import <UIKit/UIKit.h>
@ThinhPhan
ThinhPhan / xcode-gitignore
Last active August 29, 2015 14:17
Xcode .gitignore file.
######################
# gitignore Xcode 6
# Created by ThinhPhan
# Version: 1.1
# Created date: 2014-08-09
# Modified date: 2015-03-14
#######################
### Xcode private settings ###
#
@ThinhPhan
ThinhPhan / HowtoUnwindSegueProgramatically
Created March 25, 2015 03:41
How to Unwind Segue Programatically
How to Unwind Segue Programatically
===========
1. In your storyboard create two view controllers.
2. Subclass UIViewController twice, once for each of the view
controllers in your storyboard.
3. Connect these view controllers to the view controllers in your
storyboard.
@ThinhPhan
ThinhPhan / git-log-graph
Created April 2, 2015 18:14
Pretty git branch graphs
link: http://stackoverflow.com/a/9074343
Add these in "~/.gitconfig" file
[alias]
lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lg = !"git lg1"
@ThinhPhan
ThinhPhan / project-prefix.pch
Created April 8, 2015 07:59
Xcode Project-prefix Debug Log
//
// Prefix header
//
// The contents of this file are implicitly included at the beginning of every source file.
//
#import <Availability.h>
#ifndef __IPHONE_5_0
#warning "This project uses features only available in iOS SDK 5.0 and later."
@ThinhPhan
ThinhPhan / ios-locale-identifiers.csv
Last active October 17, 2015 04:12 — forked from jacobbubu/ioslocaleidentifiers.csv
Country code in iOS
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
Locale Country
mr Marathi
bs Bosnian
ee_TG Ewe (Togo)
ms Malay
kam_KE Kamba (Kenya)
mt Maltese
ha Hausa
es_HN Spanish (Honduras)
ml_IN Malayalam (India)
@ThinhPhan
ThinhPhan / NSArray+JSONString.h
Created April 26, 2015 18:40
Category for get JSON string from NSDictionary, and NSData.
//
// NSArray+JSONString.h
//
//
// Created by Thinh Phan on 4/26/15.
// Copyright (c) 2015 Gennova. All rights reserved.
//
@interface NSArray (JSONString)
- (NSString *) jsonStringWithPrettyPrint:(BOOL)prettyPrint;
@ThinhPhan
ThinhPhan / numberic-check.m
Created May 8, 2015 15:31
Check a string is a number or not
- (BOOL)isNumeric:(NSString *)string
{
NSScanner *scanner = [NSScanner scannerWithString:string];
return [scanner scanInteger:NULL] && [scanner isAtEnd];
}