This file contains hidden or 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
    
  
  
    
  | /** | |
| * Deep diff between two object, using lodash | |
| * @param {Object} object Object compared | |
| * @param {Object} base Object to compare with | |
| * @return {Object} Return a new object who represent the diff | |
| */ | |
| function difference(object, base) { | |
| function changes(object, base) { | |
| return _.transform(object, function(result, value, key) { | |
| if (!_.isEqual(value, base[key])) { | 
  
    
      This file contains hidden or 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
    
  
  
    
  | FROM theiaide/theia | |
| USER root | |
| RUN echo "http://mirrors.aliyun.com/alpine/v3.8/main/" > /etc/apk/repositories | |
| RUN apk update && apk add python make tzdata vim \ | |
| && rm -f /etc/localtime \ | |
| && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime | 
  
    
      This file contains hidden or 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
    
  
  
    
  | cat <<EOF> /etc/yum.repos.d/kubernetes.repo | |
| [kubernetes] | |
| name=Kubernetes | |
| baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64 | |
| enabled=1 | |
| gpgcheck=0 | |
| EOF | 
  
    
      This file contains hidden or 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/bash | |
| # Docker空间清理脚本 | |
| # Author: Daniel | |
| # Date: 2017/12/11 | |
| # Version: 1.0 | |
| none_image=`docker images -f 'dangling=true' -q` | |
| if [ "_$none_image" != "_" ]; then | |
| docker rmi -f $none_image | |
| echo "删除none的镜像 --> ok!" | 
  
    
      This file contains hidden or 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/bash | |
| # 1.创建nginx目录 | |
| mkdir /opt/nginx && cd /opt/nginx | |
| # 1.1注册nginx启动脚本 | |
| tee /opt/nginx/up.sh <<-'EOF' | |
| #/bin/bash | |
| if [ ! -d $PWD/certs ]; then | |
| mkdir $PWD/certs | 
  
    
      This file contains hidden or 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 crypto = require('crypto'); | |
| /** | |
| * 根据传入对象生成签名并返回 | |
| * @param object 原始对象 | |
| * @returns {*} 签名值 | |
| */ | |
| app.sign = (object) => { | |
| console.log('生成签名前的对象:' + JSON.stringify(object, null, 0)); | |
| if (!object || Object.keys(object).length == 0) return null; |