Skip to content

Instantly share code, notes, and snippets.

Avatar
😀

David Ng david90

😀
View GitHub Profile
@david90
david90 / skip_extension
Created Jul 8, 2015
Check not in extension
View skip_extension
#if !(defined(__has_feature) && __has_feature(attribute_availability_app_extension))
// some [UIApplication sharedApplication] code
#endif
@david90
david90 / gist:92e87125154dd268351b
Created Jul 7, 2015
Regex to block spam referral in google analytics
View gist:92e87125154dd268351b
(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)
View meta-tags.md

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 Jul 8, 2014
Compare Version String in iOS
View compareVersion.mm
- (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) {
View sshTunnel
ssh -D 8080 -C -N username@example.com
View CopyPublicKey
pbcopy < ~/.ssh/id_rsa.pub
# Copies the contents of the id_rsa.pub file to your clipboard