ES6: 快速体验,及实用小贴士
2016 年是 ES6 大力推广和普及的黄金时期,也是今年的流行趋势, 就一个 ES6 关键词, 在 GitHub 上就有这么多搜索结果。(赶紧跟上大部队!)
ES6: 快速体验,及实用小贴士
2016 年是 ES6 大力推广和普及的黄金时期,也是今年的流行趋势, 就一个 ES6 关键词, 在 GitHub 上就有这么多搜索结果。(赶紧跟上大部队!)
'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 |
//: 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 | |
$ docker-compose stop | |
$ docker-machine stop dev |
$ 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” |
$ # 查看命令行帮助 | |
$ docker-compose | |
$ # 创建 | |
$ docker-compose build | |
$ # 启动 app, redis, mongo 等服务,特点是常驻前台 | |
$ docker-compose up | |
$ # 也可以通过 `start` 启动,特点是常驻在后台 | |
$ docker-compose start | |
$ # 停止服务 | |
$ docker-compose stop |
$ cd docker-express-mongoose-redis-example | |
$ touch docker-compose.yml |
app: | |
build: . | |
volumes: | |
— .:/src | |
links: | |
— mongo | |
— redis | |
ports: | |
— 3000:3000 |
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 |