Skip to content

Instantly share code, notes, and snippets.

View huangguozhen's full-sized avatar

huangguozhen huangguozhen

View GitHub Profile
nginx 配置文件由简单指令和块指令构成。
简单的指令包括名称和参数,并由空格分割,以分号(;)结束
块指令和简单指令有相同的结构,不过他不是使用分号结束,而是使用一对花括号包起来作为一个指令块
如果指令可以包含其他指令块,我们称之为上下文。例如:events,http,server和location
events和http指令属于主上下文。server包含于http,location包含于server
```
http {
server {
}
1. alias
```
context: location
```
Defines a replacement for the specified location. For example, with the following configuration
location /i/ {
alias /data/w3/images/;
}
浏览器缓存
1、Last-Modified
在浏览器第一次请求某一个URL时,服务器端的返回状态会是200,内容是你请求的资源,同时有一个Last-Modified的属性标记(HttpReponse Header)此文件在服务期端最后被修改的时间,格式类似这样:
Last-Modified:Tue, 24 Feb 2009 08:01:04 GMT
客户端第二次请求此URL时,根据HTTP协议的规定,浏览器会向服务器传送If-Modified-Since报头(HttpRequest Header),询问该时间之后文件是否有被修改过:
If-Modified-Since:Tue, 24 Feb 2009 08:01:04 GMT
如果服务器端的资源没有变化,则自动返回HTTP304(NotChanged.)状态码,内容为空,这样就节省了传输数据量。当服务器端代码发生改变或者重启服务器时,则重新发出资源,返回和第一次请求时类似。从而保证不向客户端重复发出资源,也保证当服务器有变化时,客户端能够得到最新的资源。
注:如果If-Modified-Since的时间比服务器当前时间(当前的请求时间request_time)还晚,会认为是个非法请求
2、Etag工作原理
React 组织
1,节点(createElement)
2,组件(createClass or Components)
3,属性(props)
4,状态(state)
5,事件
6,生命周期
Redux API
1,createStore(reducer, [initialState])
Basic data type:
Boolean
null
undefined
Number
String
Symbol
Object
在包含加法运算符的数字和字符串表达式中,数字值会转化为字符串。
100 "continue"
101 "switching protocols"
102 "processing"
200 "ok"
201 "created"
202 "accepted"
203 "non-authoritative information"
204 "no content"
205 "reset content"
206 "partial content"
从livecd启动ubuntu,选择"试用ubuntu",进入系统后执行如下操作:
```
sudo -i
mount /dev/sda7 /mnt (也就是你Ubuntu系统的"/"的挂接硬盘分区, 比如sda7,
根据你的具体安装情况确定,/mnt是你建立的一个用来挂载的目录)
如果单独划分了Ubuntu的boot分区,那么还需如下操作:
mount /dev/sda6 /mnt/boot (假设你的boot分区是在sda6)
#!/bin/bash
# Build latest version of Emacs, version management with stow
# OS: Ubuntu 14.04 LTS
# version: 24.5
# Toolkit: lucid
# Warning, use updated version of this script in: https://github.com/favadi/build-emacs
set -e
@huangguozhen
huangguozhen / gulpfile.js
Created April 13, 2016 07:48 — forked from danharper/gulpfile.js
New ES6 project with Babel, Browserify & Gulp
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));
<link rel="shortcut icon" href="data:;base64,iVBORw0KGgo=" />