Skip to content

Instantly share code, notes, and snippets.

FROM daocloud.io/node:carbon as build-deps
WORKDIR /usr/web
COPY . ./
RUN yarn config set registry https://registry.npm.taobao.org
RUN yarn install
RUN yarn build
FROM daocloud.io/nginx
WORKDIR /web
@wanghuida
wanghuida / gist:8001308
Created December 17, 2013 07:24
retry connect when redis throw error
pool = redis.ConnectionPool(host='localhost', port=6379, db=0);
redisHandle = redis.StrictRedis(connection_pool=pool);
def retry():
try:
print redisHandle.ping();
except Exception,e:
print e
time.sleep(3);
retry();
@wanghuida
wanghuida / generate-xdebug-coverage.php
Created December 21, 2012 06:06
generate xdebug coverage
<?php
$xdebug_coverage_log_file_prefix = "/tmp/xdebug/v2-coverageLog-";
xdebug_start_code_coverage();
register_shutdown_function('coverageLog');
$xdebug_coverage_log_file = $xdebug_coverage_log_file_prefix . date('Ymd') . '.log';
function coverageLog() {
global $xdebug_coverage_log_file;
$logs = xdebug_get_code_coverage();