npm install
根据 package.json
文件中的 dependencies
和
devDependencies
来安装模块。
npm install --production
根据 package.json
文件中的 dependencies
来安装
模块。
并写入 package.json 文件的 dependencies
里面。
npm install moduleName
具体安装到哪里,可以用 npm config get prefix
查看。
npm install -g moduleName
并写入 package.json 文件的 dependencies
里面。
npm install --save-prod moduleName
并写入 package.json 文件的 devDependencies
里面。
npm install --save-dev moduleName
一些开发时会用到的,但是部署时用不到的,就用 -save-dev
,比如 eslint
。
新建项目的时候,使用这个命令会在当前目录下创建 package.json
文件。
npm init
安装 clang-format
sudo apt install clang-format
获取一个配置文件
clang-format -style=llvm -dump-config > .clang-format
clang-format -style=google -dump-config > .clang-format
clang-format 会自动查找 .clang-format 配置文件,当前目录找不到会找父目录。 所以可以在 HOME 目录下生成一个 .clang-format。
http://releases.llvm.org
http://clang.llvm.org/docs/ClangFormat.html#vim-integration
https://github.com/rhysd/vim-clang-format.git
https://clang.llvm.org/docs/ClangFormatStyleOptions.html
EssentialC 百度网盘链接 提取码: f4vx
C Primer Plus
C 和指针,POINTERS ON C
C 专家编程,Expert C Programming
C 陷阱与缺陷,C Traps and Pitfalls,百度网盘链接 提取码: 6z6r
Kernighan 和 Ritchie: The C Programming Language
Harbison 和 Steele: C: A Reference Manual
Van Wyk: Data Structures And C Programs
Horton: How To Write Portable Programs In C, Prentice-Hall, 1989
Kernighan 和 Pike: The Unix Programming Environment, Prentice-Hall, 1984
Feuer: The C Puzzle Book
Redis 设计与实现
select * from information_schema.tables;
SELECT
table_schema,
SUM((data_length + index_length) / 1024 / 1024) AS MB
FROM
information_schema.tables
GROUP BY 1;
SELECT
table_schema,
SUM((data_length + index_length) / 1024 / 1024) AS MB
FROM
information_schema.tables
WHERE
table_schema = 'This is your database name'
GROUP BY table_schema;
SELECT
COUNT(*)
FROM
information_schema.tables
WHERE
table_schema = 'This is your database name';
SELECT
table_schema,
table_name,
(data_length + index_length) / 1024 / 1024 AS MB
FROM
information_schema.tables
WHERE
table_schema = 'This is your database name';
https://github.com/getify/You-Dont-Know-JS
Mastering The Developer Tools Console
http://es6.ruanyifeng.com/ : es6 教程
https://npm.taobao.org/ : cnpm 配置
https://cnodejs.org/ : cnodejs 论坛
libuv : nodejs 底层事件驱动
the-super-tiny-compiler : 用 js 实现的一个超小的编译器
javascript-algorithms : 用 js 实现基础数据结构和算法
https://developer.mozilla.org/zh-CN/docs/Web/Tutorials : MDN 教程
https://stackoverflow.com/questions/111102/how-do-javascript-closures-work
https://github.com/addyosmani/essential-js-design-patterns
https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Guide
https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects
https://github.com/justjavac/free-programming-books-zh_CN#javascript
$ cat /proc/[pid]/status| grep Vm
VmPeak: 704480 kB
VmSize: 647140 kB
VmLck: 0 kB
VmPin: 0 kB
VmHWM: 13192 kB
VmRSS: 13192 kB
VmData: 235720 kB
VmStk: 140 kB
VmExe: 10556 kB
VmLib: 2056 kB
VmPTE: 208 kB
VmSwap: 0 kB
man proc | vim -
/\/proc\/\[pid\]\/status
* VmPeak: Peak virtual memory size.
* VmSize: Virtual memory size.
* VmLck: Locked memory size (see mlock(3)).
* VmPin: Pinned memory size (since Linux 3.2). These are pages that can't be moved because something needs to directly access physical memory.
* VmHWM: Peak resident set size ("high water mark").
* VmRSS: Resident set size.
* VmData, VmStk, VmExe: Size of data, stack, and text segments.
* VmLib: Shared library code size.
* VmPTE: Page table entries size (since Linux 2.6.10).
* VmPMD: Size of second-level page tables (since Linux 4.0).
* VmSwap: Swapped-out virtual memory size by anonymous private pages; shmem swap usage is not included (since Linux 2.6.34).
VmRss 就是实际占用的物理内存大小。
In computing, resident set size (RSS) is the portion of memory occupied by a process that is held in main memory (RAM). The rest of the occupied memory exists in the swap space or file system, either because some parts of the occupied memory were paged out, or because some parts of the executable were never loaded.