MXOXW

Life always finds a way.

git颜色配置

| Comments

git config

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
[user]
email =
name =
[core]
editor = 'D:\\Program Files\\SublimeText\\subl.exe' -w
longpaths = true
truequotepath = false
excludesfile = "D:\\Documents\\My Document\\BackUp\\.gitignore"
[alias]
st = status
sh = show
pl = pull
pu = push
ft = fetch
ss = stash
cm = commit
br = branch
cl = clone
co = checkout
df = diff
dfl = diff --stat
dft = difftool
dfr = diff origin master
dfrl = diff origin master --stat
mg = merge
mgt = mergetool
lg = log --color --graph --pretty=format:'%C(magenta)%h%Creset -%C(yellow)%d%Creset %s %C(green)(%cr) %C(cyan)<%an>%Creset' --abbrev-commit
truelast = log -1
[commit]
template = D:\\Documents\\My Document\\BackUp\\.gitmessage.txt
[color]
ui = true
[diff]
tool = bc4
[difftool "bc4"]
cmd = \"D:/Program Files/Beyond Compare 4/BComp.exe\" \"$LOCAL\" \"$REMOTE\"
trustExitCode = true
[merge]
tool = bc4
conflictstyle = diff3
[mergetool "bc4"]
cmd = \"D:/Program Files/Beyond Compare 4/BComp.exe\" \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\"
trustExitCode = true
[credential]
truehelper = wincred
[difftool]
trueprompt = false

bold
dim
ul
blink
reverse

支持的颜色
normal
black
red
green
yellow
blue
magenta
cyan
white

解决outlook2016不能预览Excel

| Comments

修改注册表
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\REGISTRY\MACHINE\Software\Microsoft\Windows\CurrentVersion\PreviewHandlers

添加字符串项{00020827-0000-0000-C000-000000000046}值为Microsoft Excel previewer

附件:
outlook_preview_xls

2015-10-15面试总结

| Comments

问题:

  • 浏览器白屏检测
  • 获取页面标题
  • 页面中JS消耗CPU
  • 原型与原型链
  • 垃圾回收,栈中引用占用字节
  • http请求响应过程

浏览器缓存和304小结

| Comments

昨天有网友在询问关于浏览器缓存的问题,只记得以前写PHP的时候,自己简单地写过Etag的304方式,倒是没有认真看过浏览器本地缓存和304的区别,今天做了一些资料查询和测试,总结一下。

关于浏览器缓存

浏览器的资源请求,如果使用了缓存基本上是两种情况

status code: 200 ok ( from cache )
browser-cache

status code: 304 Not Modified
browser-cache

上面两种方式有什么区别呢?简单地说,第一种方式是不向浏览器发送请求,直接使用本地缓存文件。第二种方式,浏览器虽然发现了本地有该资源的缓存,但是不确定是否是最新的,于是想服务器询问,若服务器认为浏览器的缓存版本还可用,那么便会返回304。

2015-10-14面试总结

| Comments

问题:

  • 浏览器缓存,服务端何时返回304
  • 网络优化方法(HTML5)
  • HTTP协议
  • HTTP2.0
  • ECMAScript 6
  • Ajax
  • meta link标签用法
  • img的src为空,是否发送请求
  • 数组去重
1
2
3
4
5
6
7
8
9
10
11
12
13
//数组去重
function unique(a){
var o={},b=[];
for (var i = 0; i < a.length; i++) {
if (!o[a[i]]) {
b.push(a[i]);
o[a[i]]=1;
}
}
return b;
}

console.log(unique([1,4,6,9,3,6,2,7,3,5,1,6]));

<img src="" alt="" onload="alert('img')"/>不同浏览器有不同效果
使用<img />不会发送请求

ECMAScript 6

参考: http://segmentfault.com/a/1190000003818502

200 OK (from cache) 与 304 Not Modified

点击刷新按钮或者F5,返回304 Not Modified;如果是地址栏确定,则是200 OK (from cache)。

参考: 浏览器缓存和304小结 - Neekey

浏览器缓存机制详解 | 芒果小站

<meta>,<link>

参考: https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/meta
https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/link