Open xgqfrms opened 6 years ago
EADDRINUSE
means that the port number which listen() tries to bind the server to isalready in use
.
https://stackoverflow.com/questions/9898372/how-to-fix-error-listen-eaddrinuse-while-using-nodejs
# admin
$ netstat -a -b
# CMD
$ netstat -o
$ netstat -a -o
bug
.showPanel {
display: block;
/* height: 100%; */
-webkit-transition: display 1.0s 1.0s ease-in;
transition: all 1.0s 1.0s ease-in;
}
.hidePanel {
display: none;
/* height: 0; */
-webkit-transition: display 1.0s 1.0s ease-out;
transition: all 1.0s 1.0s ease-out;
}
// 这段 CSS 为什么没有过度效果呢?
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animated_properties
<!DOCTYPE html>
<html lang="en">
<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>Open Window with title</title>
</head>
<body>
<button onclick="openWin(event)" data-uid="001">Open Window 1</button>
<button onclick="openWin(event)" data-uid="002">Open Window 2</button>
<button onclick="closeWin()">Close "myWindow"</button>
<script>
var myWindow = ``;
let key = ``;
function openWin(e) {
key = e.target.dataset.uid;
console.log(`key = ${key}`);
if (myWindow === ``) {
myWindow = window.open("./new-window.html", "myWindow", "width=200,height=100");
// myWindow = window.open("", "myWindow", "width=200,height=100");
myWindow.document.head.title.innerHTML = "new title";
// myWindow.document.body.innerHTML = `<h1>key : ${key}</h1>`;
} else {
myWindow.document.head.title.innerHTML = "new title";
// myWindow.document.body.innerHTML = `<h1>key : ${key}</h1>`;
}
}
function closeWin() {
myWindow.close();
}
</script>
</body>
</html>
#!/bin/sh
# echo "^-v-^ JSON DB is running in development env!" && npm run db
# echo "^-v-^ JSON DB is running in development env!" && nodemon -w ./server.js localhost 8888
JSONDB="nodemon -w ./server.js localhost 8888"
${JSONDB} &
# chmod +x db.sh
# sudo ./db.sh
# nodemon -w ./server.js localhost 8888
# /bin/sh db.sh
# ps -ef | grep node
# sudo kill -9 <PID>
https://www.brighthub.com/computing/linux/articles/68762.aspx https://www.cyberciti.biz/faq/kill-process-in-linux-or-terminate-a-process-in-unix-or-linux-systems/
https://www.linux.com/learn/intro-to-linux/2017/5/how-kill-process-command-line
# kill - Kill a process by ID
# killall - Kill a process by name
$ ps aux | grep chrome
# a = show processes for all users
# u = display the process's user/owner
# x = also show processes not attached to a terminal
https://www.linux.com/learn/intro-to-linux/2017/5/how-kill-process-command-line
https://www.linux.com/learn/intro-to-linux/2017/5/how-kill-process-command-line
# kill all node PID
$ killall -9 node
node
https://stackoverflow.com/questions/31649267/how-to-kill-a-nodejs-process-in-linux
https://linux.die.net/man/1/killall
https://askubuntu.com/questions/607253/ps-xa-grep-node-to-kill-specific-process
https://stackoverflow.com/questions/31649267/how-to-kill-a-nodejs-process-in-linux
dynamic module imports
http://2ality.com/2017/01/import-operator.html#async-functions-and-import
<!-- template -->
<div data-div="templates-special-empty-placeholder">
<template data-template="template-special-empty-placeholder">
<section class="gildata_main-module-content-box data-handle-content" data-box="empty-placeholder-overflow-scroll-box" data-handle="content" data-uid="special-empty-placeholder">
</section>
<!-- <script src="../templates/special-empty-placeholder.js"></script> -->
<script>
const moduleSpecifier = "../templates/special-empty-placeholder.js";
import(moduleSpecifier).then((module) => {
console.log(`module =\n`, module);
module.emptyModule();
});
</script>
</template>
</div>
(async () => {
const myModule = await import('./myModule.js');
})();
async function main() {
const myModule = await import('./myModule.js');
const {export1, export2} = await import('./myModule.js');
const [module1, module2, module3] =
await Promise.all([
import('./module1.js'),
import('./module2.js'),
import('./module3.js'),
]);
}
main();
https://www.npmjs.com/package/node-es-module-loader https://github.com/airbnb/babel-plugin-dynamic-import-webpack
https://webpack.js.org/guides/code-splitting/#dynamic-imports
https://github.com/shaodahong/webpack-more/blob/master/webpack.config.js
https://github.com/shaodahong/jd-happy/blob/master/index.js
https://github.com/shaodahong/web-topic https://github.com/alex/what-happens-when https://github.com/skyline75489/what-happens-when-zh_CN
https://github.com/HIT-Alibaba/interview/blob/master/package.json
deploy.sh
https://github.com/HIT-Alibaba/interview/blob/master/develop.sh
#!/bin/sh
cd ..
mkdir interview-gitbook
cd interview-gitbook
git init
git remote add origin https://github.com/HIT-Alibaba/interview.git
git fetch
git checkout gh-pages
cd ../interview
cd source
gitbook install
cd ..
http://2ality.com/2017/01/import-operator.html#async-functions-and-import
https://webpack.js.org/guides/code-splitting/#dynamic-imports
https://webpack.js.org/guides/lazy-loading/ https://alexjoverm.github.io/2017/07/16/Lazy-load-in-Vue-using-Webpack-s-code-splitting/ https://router.vuejs.org/guide/advanced/lazy-loading.html
https://reacttraining.com/react-router/web/guides/code-splitting
https://dzone.com/articles/lazy-loading-es2015-modules-in-the-browser
includes.js
https://github.com/mathiasbynens/String.prototype.includes/blob/master/includes.js
babel-polyfill
cd /usr/local/apache2/webapps/tPlatform/api &&./db.sh
cd /usr/local/apache2/webapps/F10/api &&./db.sh
ps -ef | grep node
killall -9 node
就是页面不可见的情况下就会出现问题
document.visibilityState 试下在页面最小化的时候清除定时器
https://developer.mozilla.org/zh-CN/docs/Web/API/Document/visibilityState
https://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf
let shitJSON = "{
version: '1.0',
defaultSchema: 'root',
schemas: [
{
name: 'root',
cache:'false',
type: 'custom',
factory: 'org.gil.sydb.server.schema.BaseSchemaFactory',
operand: {
tables:['*']
}
},
{
name: 'news',
type: 'custom',
factory: 'org.gil.sydb.server.schema.BaseSchemaFactory',
operand: {
tables:['MockTable']
}
}
]
}
";
JSON.parse(json.data);
> M82:2 Uncaught SyntaxError: Unexpected token v in JSON at position 4
at JSON.parse (<anonymous>)
at <anonymous>:1:6
// let json = data.replace(/\\n/ig, ``);
// json = JSON.stringify(json, null, 4);
__proto__
&prototype
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/prototype https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/prototype
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto
https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript-DOM_Prototypes_in_Mozilla
https://stackoverflow.com/questions/3082791/javascript-and-proto-what-browsers-use-it