摘要: 1 const moment = require( 'moment' ); 2 3 const begin_date = '2017-12-12', 4 end_date = '2018-01-19', 5 arr = getAllDays( begin_date, end_date ); 6 7 console.log( 'arr: ', arr ); 8 ... 阅读全文
posted @ 2017-12-19 00:16 金色元年 阅读(819) 评论(0) 推荐(0) 编辑
摘要: var assert = require('assert'); describe('mocha', function() { describe('#indexOf()', function() { it('mocha test', function() { var EQUAL = '0', RIGHT = '1',... 阅读全文
posted @ 2017-12-07 16:59 金色元年 阅读(935) 评论(0) 推荐(0) 编辑
摘要: const str = ',,,,' + ',,,'; const reg = /|\s))/g; console.log(str.replace(reg, '<$1p')); 阅读全文
posted @ 2017-09-19 14:46 金色元年 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 1. 文件撤销 以提问中修改了两个文件a、b为例,假设需要撤销文件a的修改,则修改后的两个文件: a、如果没有被git add到索引区 git checkout a 便可撤销对文件a的修改 b、如果被git add到索引区,但没有做git commit提交 1)使用git reset将a从索引区移除 阅读全文
posted @ 2017-03-03 17:18 金色元年 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 1 const request = require('request'), 2 fs = require('fs'), 3 path = require('path'); 4 5 6 const image_url = 'http://animalonline.info/wp-content/uploads/2015/01000/white-cat-9kspvw8... 阅读全文
posted @ 2017-02-24 16:32 金色元年 阅读(342) 评论(0) 推荐(0) 编辑
摘要: 环境: nodejs - v6.2.0 阅读全文
posted @ 2016-11-22 23:34 金色元年 阅读(604) 评论(0) 推荐(0) 编辑
摘要: 1 var assert = require('assert'); 2 describe('test', function() { 3 it('coc', function() { 4 var testCard01 = checkHKIDcard("AB987654(2)"); 5 assert(testCard01, true); 6 7... 阅读全文
posted @ 2016-10-19 23:57 金色元年 阅读(874) 评论(0) 推荐(0) 编辑
摘要: 1. Largest Number For example, given [3, 30, 34, 5, 9], the largest formed number is 9534330. 阅读全文
posted @ 2016-10-10 22:55 金色元年 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 代码运行环境: nodejs + mochajs 阅读全文
posted @ 2016-10-10 15:13 金色元年 阅读(148) 评论(0) 推荐(0) 编辑
摘要: var should = require('should'); describe('Array', function() { describe('#indexOf()', function() { it('should return -1 when the value is not present', function() { true.should.be.eql(v... 阅读全文
posted @ 2016-09-19 18:05 金色元年 阅读(223) 评论(0) 推荐(0) 编辑