View convert nums to zh_cn
```
function getCode(num) {
num = (num + '').split('');
var map = {0: '', 1: '一', 2: '二', 3: '三', 4: '四', 5: '五', 6: '六', 7: '七', 8: '八', 9: '九', 10: '十'};
var _map = {0: '', 1: '十', 2: '百', 3: '千', 4: '万'};
var now;
var index = 0;
var re = [];
while((now = num.pop())) {
if (+now) {
View shell-command
# 得到ip地址(awk使用)
ifconfig | grep "Mask" | awk '$2 {print $2}' | awk -F ':' '{print $2}'
# 找到匹配的文件并删除
find . -name *.jpg -exec rm -rf {} \
# 内容替换
tr "\\n" " "
# 拷贝文件(忽略掉某些文件)
View check date
/**
* @description 判断是否为合法的日期字符串
* @param {String} str 目标字符串
* @return {Boolean} 是否是合法的
*/
function check(str) {
var obj = {
1: 31,
2: 28,
3: 31,
View gist:8108791
function isMouseLeaveOrEnter(e, handler) {
if (e.type != 'mouseout' && e.type != 'mouseover') return false;
var reltg = e.relatedTarget ? e.relatedTarget : e.type == 'mouseout' ? e.toElement : e.fromElement;
while (reltg && reltg != handler)
reltg = reltg.parentNode;
return (reltg != handler);
}