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
[{"cn":"中国","en":"China","phone_code":"+86"}, | |
{"cn":"美国","en":"United States","phone_code":"+1"}, | |
{"cn":"中国香港","en":"Hong Kong (SAR)","phone_code":"+852"}, | |
{"cn":"中国澳门","en":"Macao","phone_code":"+853"}, | |
{"cn":"中国台湾","en":"Taiwan","phone_code":"+886"}, | |
{"cn":"英国","en":"United Kingdom","phone_code":"+44"}, | |
{"cn":"阿富汗","en":"Afghanistan","phone_code":"+93"}, | |
{"cn":"阿尔巴尼亚","en":"Albania","phone_code":"+355"}, | |
{"cn":"阿尔及利亚","en":"Algeria","phone_code":"+213"}, | |
{"cn":"美属萨摩亚","en":"American Samoa","phone_code":"+684"}, |
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
``` | |
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) { |
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
# 得到ip地址(awk使用) | |
ifconfig | grep "Mask" | awk '$2 {print $2}' | awk -F ':' '{print $2}' | |
# 找到匹配的文件并删除 | |
find . -name *.jpg -exec rm -rf {} \ | |
# 内容替换 | |
tr "\\n" " " | |
# 拷贝文件(忽略掉某些文件) |
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
/** | |
* @description 判断是否为合法的日期字符串 | |
* @param {String} str 目标字符串 | |
* @return {Boolean} 是否是合法的 | |
*/ | |
function check(str) { | |
var obj = { | |
1: 31, | |
2: 28, | |
3: 31, |
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
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); | |
} |