Fork me on GitHub
  1. 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

    There are comments.

  2. 关于通过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

    There are comments.

  3. docker

    访问容器

    docker exec -it <CONTAINER ID> /bin/bash

    拷贝容器文件至本地

    docker cp <IMAGE>:<容器路径> <本地路径>

    拷贝本地文件至容器

    docker cp <本地文件> <IMAGE>:<容器路 …

    read more

    There are comments.

  4. 解决Cannot find module '../lib/completion'

    // package.json
    {
        "scripts": {
            "build": "gulp build"
        }
    }
    

    错误:

    Error: Cannot find module '../lib/completion'
        at Function.Module._resolveFilename (module.js:469:15)
        at Function.Module._load (module.js:417:25)
        at Module.require (module.js:497:17)
        at require (internal/module.js:20:19)
        at Object.<anonymous> (/staticDisk/repository/jenkins …
    read more

    There are comments.

  5. element-ui + element-theme + vue-cli + postcss-px2rem

    • element-ui: 1.4.2
    • vue-cli: 2.8.2
    // utils.j
    exports.cssLoaders = function (options) {
        ...
        return {
            css: generateLoaders('postcss', {
                plugins() {
                    return [require('postcss-px2rem')({ remUnit: 75 })]
                }
            }),
            ...
        }
    }
    
    // vue-loader.conf.js
    module.exports = {
        ...
        postcss: [require('postcss-px2rem')({ remUnit: 75 })],
        ...
    }
    
    read more

    There are comments.

  6. 查看Swift代码执行时间

    func measure(title: String!, call: () -> Void) {
        let startTime = CACurrentMediaTime()
        call()
        let endTime = CACurrentMediaTime()
        if let title = title {
            print("\(title): ")
        }
        print("Time - \(endTime - startTime)")
     }
    
    func doSomeWork() {
      measure("Array") {
      var ar = [String]()
      for i in 0...10000 {
      ar.append("New elem \(i)")
      }
      }
      measure("Image") {
      let url = NSURL(string: "http://lorempixel.com/1920 …
    read more

    There are comments.

links