This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
init |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var debug = process.env.NODE_ENV !== "production"; | |
var webpack = require('webpack'); | |
module.exports = { | |
context: __dirname, | |
devtool: debug ? "inline-sourcemap" : null, | |
entry: "./js/scripts.js", | |
output: { | |
path: __dirname + "/js", | |
filename: "scripts.min.js" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var add = function(a,b){ | |
return a + b; | |
}; | |
/* 方法调用模式 */ | |
// 创建myObject,它有一个 value 属性和一个 increment 方法。 | |
// increment方法接受一个可选的参数。如果参数不是数字,那么默认使用数字1。 | |
var myObject = { | |
value :0, | |
increment:function(inc){ | |
this.value +=typeof inc ==='number'? inc:1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var add = function (a, b) { | |
if (typeof a !== 'number' || typeof b !== 'number') { | |
throw{ | |
name: 'TypeError', | |
message: 'add needs numbers' | |
}; | |
} | |
return a + b; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// apply 方法让我们构建一个参数数组传递给调用函数。它也允许我们选择this的值,apply方法接收两个参数,第一个是要绑定给this的值,第2个是一个参数数组。 | |
var add = function(a,b){ | |
return a+b; | |
} | |
var array = []; | |
var sum =add.apply(null,array); | |
console.log(sum); // sum == 7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root = true | |
[*] | |
indent_style = space | |
indent_size = 2 | |
end_of_line = lf | |
charset = utf-8 | |
trim_trailing_whitespace = true | |
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
sudo curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - | |
sudo apt-get install -y nodejs | |
sudo apt update | |
sudo apt -y upgrade | |
sudo apt -y autoremove |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* { | |
box-sizing: border-box; | |
} | |
*:before, | |
*:after { | |
box-sizing: border-box; | |
} | |
body { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>The HTTP access had been disabled!</title> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
listen 443; | |
listen [::]:80; | |
listen [::]:443; | |
server_name fonts.lug.ustc.edu.cn; | |
access_log /var/log/nginx/revproxy_access.log; | |
error_log /var/log/nginx/revproxy_error.log; | |