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
#/bin/sh | |
# 依赖的node版本 | |
requiredNodeVersion="8.12.0" | |
# docker image | |
requiredImage="node:${requiredNodeVersion}" | |
# 本机已经安装的node images版本 | |
installedNodeImageVersions=`docker images node --format "{{json .Tag}}"` |
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
const WEIGHT_MAP = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2] | |
const INSPECT_MAP = ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'] | |
/** | |
* [isIdCard description] | |
* @param {String} idCard 身份证字符串 | |
* @return {Boolean} | |
*/ | |
export default function isIdCard(idCard) { | |
if (!idCard || typeof idCard !== 'string' || idCard.length < 18) return false |
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
// 文字转为CSS友好的Unicode | |
// 在JavaScript的控制台中执行 | |
// | |
// to_css_unicode('启用') ==> '\542F\7528' | |
function to_css_unicode(text) { | |
return escape(text).replace(/\%u/g, '\\'); | |
} |
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
set nocompatible " be iMproved, required | |
filetype off " required | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" vundle | |
Plugin '[email protected]:gmarik/Vundle.vim.git' | |
" powerline | |
Plugin '[email protected]:Lokaltog/vim-powerline.git' |
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
/** | |
* 判断对象的类型 | |
* @param {Object} obj | |
* @return {String} | |
*/ | |
function $typeof(obj) { | |
return Object.prototype.toString.call(obj).replace(/^\[object |\]$/g,'').toLowerCase(); | |
} | |
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
// 检测空串 | |
if (!$.trim(str)) { | |
} | |
// 字符串/数字类型转换 | |
var str = '100'; | |
var num = str - 0; |