This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.set({ | |
reporters: ['progress', 'coverage'], | |
frameworks: ['karma'], | |
files: [ | |
// 主程式,不需要 include 到網頁裡 | |
{ pattern: 'lib/*.js', included: false }, | |
// 測試程式 | |
'test/**/*.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ifeq ($(TRAVIS_BRANCH), $(filter $(TRAVIS_BRANCH), master develop)) | |
# master/develop 的時候跑 saucelabs | |
# 檢查是不是所有指定 browser 都可以通過測試 | |
travis: test-sauce | |
else | |
# 其他 branch 只跑 phantomjs | |
# 避免 saucelabs 噴錢... | |
travis: test-phantomjs | |
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DUO := node_modules/.bin/duo | |
# 主要程式碼 | |
SRC := $(shell find lib -type f -name '*.js') | |
# 所有 test 目錄下檔案,包含一些 util | |
TEST := $(shell find test -type f -name '*.js') | |
# 實際寫測試的檔案 | |
TEST_SRC := $(shell find test -type f -name '*.test.js') | |
# Build 測試檔案 |
Running 30s test @ http://http.trynginx.com:8080/
100 threads and 5000 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 449.33ms 157.09ms 793.53ms 63.26%
Req/Sec 18.36 34.73 463.00 92.53%
50663 requests in 30.08s, 9.42MB read
Socket errors: connect 244, read 5912, write 117, timeout 62001
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROJNAME = redis-mount | |
SERVICEPATH = github.com/poying | |
SOURCES = main.go help_template.go | |
GOPATH = $(shell pwd) | |
PROJPATH = src/$(SERVICEPATH)/$(PROJNAME) | |
BINFILE = ./$(PROJNAME) | |
define build | |
echo build $(PROJNAME)-$(1)-$(2); \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var domain = require('domain'); | |
var EventEmitter = require('events').EventEmitter; | |
var Bench = require('async-bench'); | |
console.log(); | |
Bench() | |
.compare(tryCatch_) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "require('./test')" | duo --root . --type js > $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
index │ children │ remove | |
───────┼─────────────────────┼──────── | |
0 │ [a] b c d e │ a | |
0 │ [d] b a f g h │ | |
│ d b c d e │ | |
───────┼─────────────────────┼──────── | |
1 │ a [b] c d e │ a | |
1 │ d [b] a f g h │ | |
│ d b c d e │ | |
───────┼─────────────────────┼──────── |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
h('div', { | |
style: { | |
textAlign: 'center', | |
verticalAlign: 'center', | |
lineHeight: (100 + count) + 'px', | |
border: '1px solid red', | |
width: (100 + count) + 'px', | |
height: (100 + count) + 'px' | |
} | |
}, [String(count)]); |