CentOS 7 32bit 下载

没错,虽然RHEL7只有64位,但CentOS 7还编译了一份32位的版本,但不在通常的镜像站,只能从官方的altarch目录下载:

http://mirror.centos.org/altarch/7/isos/i386/

JavaScript获取函数参数列表

参考了网上别人写的代码,大致是这样的:

function getArgNames(fn) {
    if (typeof(fn)==='function') {
        return fn.toString().match(/function\s*\w+\(\s*([^)]*)\)/)[1].replace(/\/\*.*?\*\/|\/\/[^\r\n]*(?:[\r\n]+|$)|\s+$/g,'').split(/\s*,\s*/);
    }
}

主要思路是调用Function.prototype.toString()获取函数的定义字符串,然后提取其中的参数列表,去除其中的注释和多余的空白,最后将他们按逗号分隔到数组里。

批量对某个目录下的git版本库执行相同操作

使用脚本git-each-repo很容易做到,它是基于bash的脚本
例如,要pull目录下的所有repo的版本库,只需

cd /path/to/base/dir
git-each-repo pull
#或者
git-each-repo -d /path/to/base/dir pull

获取最新版本:

国外

https://github.com/mjpclab/Shell-Utility/blob/master/bin/git-each-repo

国内:

https://gitee.com/mjpclab/Shell-Utility/blob/master/bin/git-each-repo