Skip to content

Instantly share code, notes, and snippets.

View tonyhhyip's full-sized avatar

Tony Yip tonyhhyip

View GitHub Profile
@tonyhhyip
tonyhhyip / Dockerfile
Created June 26, 2017 03:50
Dockerfile for Node.js Project on Circle CI Workflow with watchman
FROM node:6-alpine
RUN apk add --no-cache --virtual .vcs git openssh-client &&
apk add --no-cache --virtual .cache tar
RUN apk add --no-cache --virtual .heroku curl && \
curl https://cli-assets.heroku.com/branches/stable/heroku-linux-amd64.tar.gz -o heroku.tar.gz && \
mkdir -p /usr/local/lib /usr/local/bin && \
tar xf heroku.tar.gz -C /usr/local/lib && \
ln -s /usr/local/lib/heroku/bin/heroku /usr/local/bin/heroku && \
@tonyhhyip
tonyhhyip / school-phones.js
Created September 30, 2016 05:43
Grep all phone numbers of school with HK Gov Open Data
'use strict'
const DATA_ENDPOINT = 'http://applications.edb.gov.hk/datagovhk/data/SchoolBasicInfo.xml';
const DIST = `${__dirname}/outputs/telephone.csv`;
const fs = require('fs');
const request = require('request');
const cheerio = require('cheerio');
request(DATA_ENDPOINT, (e, response, body) => {
@tonyhhyip
tonyhhyip / swot-grepper.js
Created September 30, 2016 05:40
Grep data from HK gov Open Data and add to swot
'use strict'
const DATA_ENDPOINT = 'http://applications.edb.gov.hk/datagovhk/data/SchoolBasicInfo.xml';
const DIST = `${__dirname}/../swot/lib/domains/`;
const fs = require('fs');
const path = require('path');
const dns = require('dns');
const request = require('request');
const cheerio = require('cheerio');
@tonyhhyip
tonyhhyip / Html5FileMetaReader.html
Created January 11, 2016 07:12
Get File Metadata with HTML 5
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>File Metadata Reader</title>
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css">
<style>
#dropzone {
margin: auto;