0%

img 2 ascii

https://www.degraeve.com/img2txt.php

1
2
<style lang="scss">
</style>
1
npm install -D sass-loader node-sass

如果 sass(锁进 而不是 大括号) 需要修改

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// webpack.config.js -> module.rules
{
test: /\.sass$/,
use: [
'vue-style-loader',
'css-loader',
{
loader: 'sass-loader',
options: {
indentedSyntax: true,
// sass-loader version >= 8
sassOptions: {
indentedSyntax: true
}
}
}
]
}

less

1
npm install -D less less-loader
1
2
3
4
5
6
7
8
9
// webpack.config.js -> module.rules
{
test: /\.less$/,
use: [
'vue-style-loader',
'css-loader',
'less-loader'
]
}
1
npm install -D stylus stylus-loader

1
npm install -D pug pug-plain-loader
1
2
3
4
5
// webpack.config.js -> module.rules
{
test: /\.pug$/,
loader: 'pug-plain-loader'
}
1
2
3
4
<template lang="pug">
div
h1 Hello world!
</template>

2020 02 01 到 2020 06 03 数据

img

  • 15-24 岁 一共死亡 9,442 其中新冠是 106
  • 老人死亡率高

https://data.cdc.gov/NCHS/Provisional-COVID-19-Death-Counts-by-Sex-Age-and-S/9bhg-hcku

2020 02 01 到 2020 05 31

img
img

https://www.cdc.gov/nchs/nvss/vsrr/covid_weekly/index.htm

2017 美国死亡人数 280万

  • Number of deaths: 2,813,503
  • Death rate: 863.8 deaths per 100,000 population
  • Life expectancy: 78.6 years 平均寿命
  • Infant Mortality rate: 5.79 deaths per 1,000 live births 婴儿死亡率

死因排行

  • Heart disease: 647,457 心脏病
  • Cancer: 599,108 癌症
  • Accidents (unintentional injuries): 169,936 世故
  • Chronic lower respiratory diseases: 160,201 呼吸系统
  • Stroke (cerebrovascular diseases): 146,383 中风
  • Alzheimer’s disease: 121,404 阿尔茨海默氏病
  • Diabetes: 83,564 糖尿
  • Influenza and Pneumonia: 55,672 流感和肺炎
  • Nephritis, nephrotic syndrome and nephrosis: 50,633 肾病
  • Intentional self-harm (suicide): 47,173 自杀

2018

In 2018, a total of 2,839,205

cli 3

vue create AAA

cli 2

vue init webpack AAA

version of vue cli

1
vue --version

version of vue

1
npm list vue

2 到 3(4)

1
2
npm uninstall -g vue-cli
npm install -g @vue/cli

前者不行,改用后面 yarn,OK

1
2
yarn global remove vue-cli
yarn global add @vue/cli
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<!DOCTYPE html>
<html>
<head>
<title>SVG Graph</title>
<script src="https://unpkg.com/vue"></script>
<link rel="stylesheet" type="text/css" href="/style.css" />

<!-- template for the polygraph component. -->
<script type="text/x-template" id="polygraph-template">
<g>
<polygon :points="points"></polygon>
<circle cx="100" cy="100" r="80"></circle>
<axis-label
v-for="(stat, index) in stats"
:stat="stat"
:index="index"
:total="stats.length">2222
</axis-label>
</g>
</script>

<!-- template for the axis label component. -->
<script type="text/x-template" id="axis-label-template">
<text :x="point.x" :y="point.y">{{stat.label}}</text>
</script>
</head>
<body>
<!-- demo root element -->
<div id="demo">
<!-- Use the component -->
<svg width="200" height="200">
<polygraph :stats="stats"></polygraph>
</svg>
<!-- controls -->
<div v-for="stat in stats">
<label>{{stat.label}}</label>
<input type="range" v-model="stat.value" min="0" max="100" />
<span>{{stat.value}}</span>
<button @click="remove(stat)" class="remove">X</button>
</div>
<form id="add">
<input name="newlabel" v-model="newLabel" />
<button @click="add">Add a Stat</button>
</form>
<pre id="raw">{{ stats }}</pre>
</div>

<p style="font-size:12px">* input[type="range"] requires IE10 or above.</p>

<script>
// The raw data to observe
var stats = [
{ label: "A", value: 100 },
{ label: "B", value: 100 },
{ label: "C", value: 100 },
{ label: "D", value: 100 },
{ label: "E", value: 100 },
{ label: "F", value: 100 }
];

// A resusable polygon graph component
Vue.component("polygraph", {
props: ["stats"],
template: "#polygraph-template",
computed: {
// a computed property for the polygon's points
points: function() {
var total = this.stats.length;
return this.stats
.map(function(stat, i) {
var point = valueToPoint(stat.value, i, total);
return point.x + "," + point.y;
})
.join(" ");
}
},
components: {
// a sub component for the labels
"axis-label": {
props: {
stat: Object,
index: Number,
total: Number
},
template: "#axis-label-template",
computed: {
point: function() {
return valueToPoint(
+this.stat.value + 10,
this.index,
this.total
);
}
}
}
}
});

// math helper...
function valueToPoint(value, index, total) {
var x = 0;
var y = -value * 0.8;
var angle = ((Math.PI * 2) / total) * index;
var cos = Math.cos(angle);
var sin = Math.sin(angle);
var tx = x * cos - y * sin + 100;
var ty = x * sin + y * cos + 100;
return {
x: tx,
y: ty
};
}

// bootstrap the demo
new Vue({
el: "#demo",
data: {
newLabel: "",
stats: stats
},
methods: {
add: function(e) {
e.preventDefault();
if (!this.newLabel) return;
this.stats.push({
label: this.newLabel,
value: 100
});
this.newLabel = "";
},
remove: function(stat) {
if (this.stats.length > 3) {
this.stats.splice(this.stats.indexOf(stat), 1);
} else {
alert("Can't delete more!");
}
}
}
});
</script>
</body>
</html>

http://www.hammerspoon.org/

https://github.com/greyby/hammerspoon

apply 和 call 的区别

1
2
3
4
5
6
7
8
9
var obj = {
name : 'linxin'
}

function func(firstName, lastName){
console.log(firstName + ' ' + this.name + ' ' + lastName);
}

func.apply(obj, ['A', 'B']); // A linxin B

call 方法第一个参数也是作为函数上下文的对象,但是后面传入的是一个参数列表,而不是单个数组。

1
2
3
4
5
6
7
8
9
var obj = {
name: 'linxin'
}

function func(firstName, lastName) {
console.log(firstName + ' ' + this.name + ' ' + lastName);
}

func.call(obj, 'C', 'D'); // C linxin D

bind

1
2
3
4
5
6
7
8
9
function func(a, b, c) {
console.log(a, b, c);
}
var func1 = func.bind(null,'linxin');

func('A', 'B', 'C'); // A B C
func1('A', 'B', 'C'); // linxin A B
func1('B', 'C'); // linxin B C
func.call(null, 'linxin'); // linxin undefined undefined

via https://github.com/lin-xin/blog/issues/7

后期的每周死亡 甚至比疫情前 还低

1111
1111
1111
1111

比流感厉害

1111
1111

可以自定义查看方式。对年轻人的确并不危险。

1111

一些人的死亡提前了

1111

1
ls -d -- */
1
ls -ld -- */
1
ls -F | grep /
1
ls -d */
1
echo */
1
ls -l | grep "^d"
1
find /home/alice/Documents -maxdepth 1 -type d
1
docker run -it alpine /bin/sh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

/**
* Returns an array with arrays of the given size.
*
* @param myArray {Array} Array to split
* @param chunkSize {Integer} Size of every group
*/
function chunkArray(myArray, chunk_size){
var results = [];

while (myArray.length) {
results.push(myArray.splice(0, chunk_size));
}

return results;
}

// Split in group of 3 items
var result = chunkArray([1,2,3,4,5,6,7,8], 3);
// Outputs : [ [1,2,3] , [4,5,6] ,[7,8] ]
console.log(result);

  • 回调函数
  • 事件监听
  • 发布/订阅
  • Promise 对象

git pull 强制

1
2
3
git fetch --all
git reset --hard origin/master
git pull

回调

1
a('1.json',function(d){console.log(d);})

promise

1
2
3
4
5
6
7
8
a('1.json')
.then(function(d){
console.log(d);
return a('2.json');
})
.then(function(d){
console.log(d);
})

generator

···
function* gen(x){
var y = yield x + 2;
return y;
}

var g = gen(100);
g.next() // { value: 102, done: false }
g.next() // { value: undefined, done: true }
···

function* gen(){
var rs = yield fetch(‘1.json’,function(d){
console.log(111,d);
console.log(222,d.data);
});
console.log(rs);
}
var g = gen();
console.log(g);
g.next();
console.log(g);

fetch(‘1.json’)
.then((response) => {
return response.json();
})
.then((data) => {
console.log(data);
});