Fork me on GitHub
  1. nginx 配置https

    update: 2018-08-20

    已支持泛域名申请:https://certbot.eff.org/

    Trying to get a wildcard certificate? Please use the dropdown menus below to get instructions specific to your system, and read those instructions carefully.


    $ sudo apt-get update
    $ sudo apt-get install software-properties-common
    $ sudo add-apt-repository ppa:certbot/certbot …
    read more
  2. Git Commit Msg

    <type>(<scope>): <subject>
    
    <body>
    
    <footer>
    

    Example

    fix(middleware): ensure Range headers adhere more closely to RFC 2616
    
    Add one new dependency, use `range-parser` (Express dependency) to compute
    range. It is more well-tested in the wild.
    
    Fixes #2310
    

    Allowed values:

    • feat 针对用户来时的新功能 …
    read more
  3. yarn puppeteer错误

    error /app/node_modules/puppeteer: Command failed. Exit code: 1 Command: node install.js Arguments: Directory: /app/node_modules/puppeteer Output: ERROR: Failed to download Chromium r579032! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download. { Error: connect ETIMEDOUT 216.58.221.240:443 at Object._errnoException (util.js:992:11) at _exceptionWithHostPort (util …

    read more
  4. npm version

    版本示例:1.2.3 MAJOR.MINOR.PATCH:
    
    1.2.3
    ┬ ┬ ┬
    │ │ │
    │ │ └ 补丁版本:bug修复,向后兼容
    │ └── 次要版本:新增功能,向后兼容
    └──── 主要版本:修改不向后兼容的api
    
    示例
      1 …
    read more
  5. CommonJS和AMD/CMD

    CommonJS根据JS的表现制定规范:

    {模块引用(require)} {模块定义(exports)} {模块标识(module)}

    NodeJS遵循了CommonJS规范,写法如下:

    // foo.js
    
    module.exports = function(x) {
        console.log(x);
    };
    
    // index.js
    
    let foo = require('./foo')
    foo(1);
    

    CommonJS主要为了JS在后端制 …

    read more
  6. cron-parser

    Github: cron-parser

    *    *    *    *    *    *
                        
                        |
                         day of week (0 - 7) (0 or 7 is Sun)
                    └───── month (1 - 12)
                └────────── day of month (1 - 31)
            └─────────────── hour (0 - 23)
        └──────────────────── minute (0 - 59)
    └───────────────────────── second (0 - 59, optional)
    
    1. 每10秒执行: */10 * * * * *
    2. 每周一10点执行: 0 0 10 ? * 1
    3. 每月1号10点执行: 0 0 10 1 * ?

    暂时 …

    read more
  7. 关于通过document.styleSheets修改样式规则

    var innerText = '';
    function changeTheme() {
        try {
            var colors = JSON.parse(
                window.localStorage.getItem(window.localStorage.getItem('ROLE_ID') + '__theme')
            );
        } catch (error) { }
        if (!colors) {
            return;
        }
        var keys = ['background', 'background-color', 'color', 'border-color'];
    
        var styleSheet = document.styleSheets[0].href ? document.styleSheets[0] : document.styleSheets[1];
        for (var index = 0; index < styleSheet.rules.length; index++) {
            var …
    read more

links