Skip to content

Instantly share code, notes, and snippets.

View fundon's full-sized avatar
🎯
Focusing

Fangdun Tsai fundon

🎯
Focusing
View GitHub Profile
@fundon
fundon / ES6: QuickStart and Tips.md
Last active September 14, 2016 16:01
ES6: QuickStart and Tips

ES6: QuickStart and Tips

ES6: 快速体验,及实用小贴士

2016 年是 ES6 大力推广和普及的黄金时期,也是今年的流行趋势, 就一个 ES6 关键词, 在 GitHub 上就有这么多搜索结果。(赶紧跟上大部队!)

It's very hot!

@fundon
fundon / app.js
Created September 1, 2016 17:36
benchmarks: koa vs toa vs egg vs trek
'use strict';
module.exports = () => {
require('./koa');
require('./toa');
require('./trek');
};
func tableView(_ tableView: NSTableView, shouldSelectRow row: Int) -> Bool {
if self.selectedRow != -1 {
let rowView = tableView.rowView(atRow: self.selectedRow, makeIfNecessary: false) as? GMRowView
rowView?.isSelected = false
rowView?.backgroundColor = NSColor(red: 188/256, green: 188/256, blue: 188/256, alpha: 0)
}
if row != -1 {
self.selectedRow = row
let rowView = tableView.rowView(atRow: self.selectedRow, makeIfNecessary: false) as? GMRowView
rowView?.isSelected = true
@fundon
fundon / Contents.swift
Created July 24, 2016 06:29
objcio/S01E01-networking
//: To run this playground start a SimpleHTTPServer on the commandline like this:
//:
//: `python -m SimpleHTTPServer 8000`
//:
//: It will serve up the current directory, so make sure to be in the directory containing episodes.json
import UIKit
import PlaygroundSupport
@fundon
fundon / shut-down.sh
Created October 23, 2015 06:46
Using Docker Compose in Node.js Project
$ docker-compose stop
$ docker-machine stop dev
@fundon
fundon / open-urls.sh
Created October 23, 2015 06:44
Using Docker Compose in Node.js Project
$ open “http://$(docker-machine ip dev):3000”
$ open “http://$(docker-machine ip dev):3000/redis”
$ open “http://$(docker-machine ip dev):3000/redis/set”
$ open “http://$(docker-machine ip dev):3000/redis/get”
$ open “http://$(docker-machine ip dev):3000/mongoose”
$ open “http://$(docker-machine ip dev):3000/mongoose/set”
$ open “http://$(docker-machine ip dev):3000/mongoose/get”
@fundon
fundon / docker-compose-opts.sh
Created October 23, 2015 06:43
Using Docker Compose in Node.js Project
$ # 查看命令行帮助
$ docker-compose
$ # 创建
$ docker-compose build
$ # 启动 app, redis, mongo 等服务,特点是常驻前台
$ docker-compose up
$ # 也可以通过 `start` 启动,特点是常驻在后台
$ docker-compose start
$ # 停止服务
$ docker-compose stop
@fundon
fundon / touch-docker-compose.sh
Created October 23, 2015 06:41
Using Docker Compose in Node.js Project
$ cd docker-express-mongoose-redis-example
$ touch docker-compose.yml
@fundon
fundon / docker-compose.yml
Created October 23, 2015 06:40
Using Docker Compose in Node.js Project
app:
 build: .
 volumes:
 — .:/src
 links:
 — mongo
 — redis
 ports:
 — 3000:3000
@fundon
fundon / Dockerfile
Created October 23, 2015 06:37
Using Docker Compose in Node.js Project
FROM mhart/alpine-node
# FROM mhart/alpine-node:base
# FROM mhart/alpine-node:base-0.10
WORKDIR /src
ADD . .
# If you have native dependencies, you’ll need extra tools
RUN apk add — update make gcc g++ python