Skip to content

Instantly share code, notes, and snippets.

View david90's full-sized avatar
😛

David Ng david90

😛
View GitHub Profile
@david90
david90 / skip_extension
Created July 8, 2015 06:57
Check not in extension
#if !(defined(__has_feature) && __has_feature(attribute_availability_app_extension))
// some [UIApplication sharedApplication] code
#endif
@david90
david90 / gist:92e87125154dd268351b
Created July 7, 2015 07:10
Regex to block spam referral in google analytics
(semalt\.semalt\.com|buttons-for-website\.com|best-seo-offer\.com|buttons-for-your-website\.com|100dollars-seo\.com|www\.event-tracking\.com|floating-share-buttons\.com|free-social-buttons\.com|www\.Get-Free-Traffic-Now\.com)

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@david90
david90 / compareVersion.mm
Created July 8, 2014 09:52
Compare Version String in iOS
- (BOOL) isVersion:(NSString *)thisVersionString higherThan:(NSString *)thatVersionString {
// LOWER
if ([thisVersionString compare:thatVersionString options:NSNumericSearch] == NSOrderedAscending) {
NSLog(@"%@ < %@", thisVersionString, thatVersionString);
return NO;
}
// EQUAL
if ([thisVersionString compare:thatVersionString options:NSNumericSearch] == NSOrderedSame) {
@david90
david90 / sshTunnel
Created June 25, 2014 11:42
SSH Tunnel
ssh -D 8080 -C -N username@example.com
@david90
david90 / CopyPublicKey
Created June 25, 2014 06:42
Copy Public Key
pbcopy < ~/.ssh/id_rsa.pub
# Copies the contents of the id_rsa.pub file to your clipboard