JavaScript add 0 before number tips
A friend who often processes financial data may encounter a need to convert a string of a fixed length to a fixed length, such as 123 = 000123. Usually we will try this: let num = 123; c...
2019-01-10
2461 4 230
Travis-ci SSH Deploy
We know that the continuous integration tools such as Travis-ci can help us to do unit tests after the code is submitted. Is there any way to automatically deploy the code through SSH to the traget ma...
2018-12-27
4596 5 0
像大神一样写代码之代码质量控制
Mofei超爱开源,最近接触了不少大神的开源项目,特别羡慕这些项目的代码质量控制,再加上公司最近也在强调代码质量,在挖坑、填坑的路上总结出一些经验和大家分享。 今天想聊的是其中的持续集成、单元测试和代码覆盖率的部分。 
如果给你一串数字,需要把他转换成货币的千分位格式,你会如何去做?比如:123123123 - 123,123,123 1. 一个有意思的正则表达式的由来 这其实是个陈年老问题了,但是不知为何最近的出镜率特别高,所以决定这里讨论一下。 先看一种传统的思维:从右侧起每隔三位加一个逗号。于是就有了下面的方法: javascript function money...
2017-06-07
4336 12 6
Multithreading in JavaScript, Worker and SharedWorker
As the development of the web technical, Figuring large data in web front-end becomes more and more common. But unfortunately, when we try to deal with the work which needs the vast resource, It alwa...
2017-05-07
8263 10 7