Skip to content

Instantly share code, notes, and snippets.


David Ng david90

View GitHub Profile
View CopyPublicKey
pbcopy < ~/.ssh/
# Copies the contents of the file to your clipboard
View sshTunnel
ssh -D 8080 -C -N
david90 /
Created Jul 8, 2014
Compare Version String in iOS
- (BOOL) isVersion:(NSString *)thisVersionString higherThan:(NSString *)thatVersionString {
if ([thisVersionString compare:thatVersionString options:NSNumericSearch] == NSOrderedAscending) {
NSLog(@"%@ < %@", thisVersionString, thatVersionString);
return NO;
if ([thisVersionString compare:thatVersionString options:NSNumericSearch] == NSOrderedSame) {

Copied from

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 / gist:92e87125154dd268351b
Created Jul 7, 2015
Regex to block spam referral in google analytics
View gist:92e87125154dd268351b
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
#!/bin/bash -e
# Make sure you have installed ImageMagick
# Ensure we're running in location of script.
cd "`dirname $0`"
for f in *; do
if [[ $f == *@3x* ]];
david90 / app_metrics.js
Created Aug 6, 2015
Simple Event tracking Server that insert records to MySQL (express, mysql module needed)
View app_metrics.js
/* Server monitor */
// require('newrelic');
var mysql = require('mysql');
var express = require('express');
var app = express();
var eventsCollection;
var sessionsCollection;
/** MySQL Settings **/
david90 /
Last active Jan 18, 2017
Skygear CMS - README

CMS Plugin for Skygear

This is a Skygear Plugin to provide CMS functionality to your app.


It is easy to use CMS in your Skygear app on the cloud. To do that, add the following line in your index.js in the root of your repo:

david90 /
Created Feb 14, 2017
Code for extracting inception bottleneck feature
import os
import tensorflow as tf
import tensorflow.python.platform
from tensorflow.python.platform import gfile
import numpy as np
def create_graph(model_path):
create_graph loads the inception model to memory, should be called before
calling extract_features.
You can’t perform that action at this time.