css
CSS3 清除浮动
三个div,父级div下面有两个div分别float:left和float:right <style> .container{width:400px;border:3px soild red;} .fl{float:left;} .fr{float:right;} </style> <body> <div class="container"> <div class="fl">向左浮动</div> <div class="fr"
css
三个div,父级div下面有两个div分别float:left和float:right <style> .container{width:400px;border:3px soild red;} .fl{float:left;} .fr{float:right;} </style> <body> <div class="container"> <div class="fl">向左浮动</div> <div class="fr"
React
快速启动 yarn add create-react-app
animation版 * 主要使用@keyframes实现,x轴做匀速运动,y轴做加速运动。看起来类似抛物线运动。 html <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>JS Bin</title> </head> <body>
ES6
var 变量提升 * 全局作用域下自动转换为window对象属性,而let、const不会。 function test1() { console.log(a) // undefined if(false) { var a = 1; } console.log(a) // undefined function inner() { if(false) { var b = 2 } } console.log(b); //RefrenceError b is not defined } 示例:http://jsbin.com/tunonipare/edit?html,js,console let 块级作用域 * 可以读取外层变量、可以重新定义外层变量,但是不能在块级作用域内重新声明函数如果必须要使用函数表达式声明。块级作用域声明函数必须在大括号内。
Docker
使用docker swarm集群 1. 创建manager节点 $ docker swarm init --advertise-addr 192.168.137.218 Swarm initialized: current node (rcanhy10o17svw6guzd6ie8o5) is now a manager. To add a worker to this swarm, run the following command: $ docker swarm join --token SWMTKN-1--*** 192.168.137.218:2377 To add a manager to this swarm, run
Docker
1. docker exec :在运行的容器中执行命令 docker exec [OPTIONS] CONTAINER COMMAND [ARG...] OPTIONS说明: • -d :分离模式: 在后台运行 • -i :即使没有附加也保持STDIN 打开 • -t :分配一个伪终端 docker exec -it id /bin/sh 2. 保持docker 运行状态 docker-ngrok: image: daocloud.io/library/golang:1.4.2 command: sh -c "while true; do echo hello world; sleep 1; done&
1. docker container 启动后停止并无限重启 原因:容器内没有启动服务任何服务被回收(docker垃圾回收机制) 解决方案:1、dockerfile 末尾添加CMD启动指定服务,2、docker-compose.yml添加command命令启动指定服务 2、...
Javascript
按需加载 拆分项目代码 1、require.ensure() 2、bundle-loader + AsyncComponent 3、react-loadable 4、() => import()
Docker
docker compose docker-ngrok: image: daocloud.io/library/golang:1.4.2 command: nohup /usr/ngrok/bin/ngrokd -domain="monogogo.cn" -httpAddr=":4040" & privileged: false restart: always ports: - 4040:4040 volumes: - /usr/docker-volume/ngrok:/usr/ngrok 部署ngrok服务 * step1 cd ~ git clone https://github.com/
科学上网
1. yum update yum -y update # 这个是升级命令 效果如下图 安装 wget yum -y install wget 2. 安装ss wget –no-check-certificate https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks.sh #step1 chmod +x shadowsocks.sh #step2 ./shadowsocks.sh 2>&1 | tee shadowsocks.log #step3 3. 配置ss * 单用户配置 sudo -i vi
Nginx
HTTP基础功能: * 处理静态文件,索引文件以及自动索引; * 反向代理加速(无缓存),简单的负载均衡和容错; * FastCGI,简单的负载均衡和容错; * 模块化的结构。过滤器包括gzipping, byte ranges, chunked responses, 以及 SSI-filter 。在SSI过滤器中,到同一个 proxy 或者 FastCGI 的多个子请求并发处理; * SSL 和 TLS SNI 支持; * 重新配置和在线升级而无须中断客户的工作进程; 代理设置 ngnix.conf worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; include /etc/reverse-proxy.conf;
React
This project was bootstrapped with Create React App. Below you will find some information on how to perform common tasks. You can find the most recent version of this guide here. Table of Contents * Updating to New Releases * Sending Feedback * Folder Structure * Available Scripts * npm start * npm test * npm run
Markdown
标题 # 一级标题 ## 二级标题 ### 三级标题 一级标题 二级标题 三级标题 加粗 **加粗** 加粗 斜体 *斜体* 斜体 粗斜体 ***粗斜体*** 粗斜体 分割线 *** --- ___ 无序列表 - a - b - c - a - a1 - b2 - b - b1 * a * b * c * a * a1 * b2 * b * b1 有序列表 1. a 2. b 3. c