肉饼博客

Talk is cheap. Show me the code.

0%

1. 配置SSH安全访问密钥,关闭密码登录

a.参考SecureCRT密钥连接Linux,使用SecureCRT在本机生成公私密钥
b.在VPS对应的用户目录下,新建.ssh文件夹,并上传公钥,然后更名为authorized_keys,并修改权限,如下

阅读全文 »

方式一:原型链继承(prototype模式)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function Parent (name) {
this.name = name
this.colors = ['red','green']
}

Parent.prototype.getName = function () {
console.log(this.name)
}

function Child (age) {
this.age = age
}

Child.prototype = new Parent()
Child.prototype.constructor = Child

var child1 = new Child ('20')
console.log(child1.getName) // ƒ () {console.log(this.name)}
var child2 = new Child ('20')
child2.colors.push('blue')
console.log(child1.colors) //['red','green','blue']
console.log(child2.colors) //['red','green','blue']
阅读全文 »

一、安装nvm-windows,方便node版本切换

1
2
3
nvm list              #查看已安装的版本
nvm install 6.11.0 #安装Node.js 6.11.0,因为@angular/cli需要6.9版本以上支持
nvm use 6.11.0 #切换到新安装的版本
阅读全文 »

JS中的数据类型

5种基本数据类型:Number、String、Boolean、Null、Undefined、Symbol

1种复杂数据类型:Object(Array、Function、Reg、Date…)

阅读全文 »

问题代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
p {
border:1px solid red;
background:#eee;
}
#img2 {
width:200px;
height:200px;
}
</style>
</head>
<body>
<p><img src="1.jpg" id="img2"></p>
</body>
</html>
阅读全文 »

梦起

记得小学有位语文老师,一次在课堂上和我们聊起她去日本旅行的经历,她拿中日两国作了个简单对比,至今让我印象深刻:“……如果你在中国的大马路上不小心摔了跤,回去定得把脏衣服换了洗了,而如果是在日本,你只需要站起身,继续走你的路就好,连拍一下都不用,因为衣服根本不会脏……如果你拎着一只崭新的皮包,在中国的大城市玩上一天,回去摸摸包,一般会发现上面有一层油腻,黏糊糊,擦都擦不干净,而如果是在日本,一天下来只会留下一层薄灰,用手一抹就没了……”

阅读全文 »

快到年底了,估计很多人都在折腾这货,其实HTTPS很早就出现了,只是一直像IPv6那样,普及率不高。这次谷歌和苹果两大巨头决定强推HTTPS,估计也是因为安全问题,毕竟有了太多“前车之鉴”,是时候该有所行动了。

阅读全文 »