分类
PPT 前端 技术

B2C网站中的Responsive Design

这是前年在(前)公司内部做过的一次技术分享的PPT。直到今天才想起贴到博客上,实属惭愧。

PPT只是提纲,当时讲到的一些细节内容,以及这一年以来的一些新的想法,希望最近能有时间更新到本文中。

 

分类
技术

Mac安装npm包权限问题

在Mac上执行yeoman命令时,yeoman会自动调用npm install,安装过程中报错:

npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/n'
npm ERR! { [Error: EACCES, mkdir '/usr/local/lib/node_modules/n']
npm ERR! errno: 3, npm ERR! code: 'EACCES', …
npm install -g — ERR! Please try running this command again as root/Administrator.

这时出于习惯直接用sudo来执行yeoman,结果还是一样的:

sudo yo

看来yeoman调用npm install时没有带上sudo。

解决方案简单粗暴,修改全局npm包目录的权限:

sudo chown -R $USER /usr/local/lib/node_modules

参考资料:https://ar.al/scribbles/npm-install-g-please-try-running-this-command-again-as-root-administrator/

分类
English 前端 技术 转载文章

[转载] What forces layout / reflow

What forces layout / reflow

By Paul Irish

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout. This is also called reflow or layout thrashing, and is common performance bottleneck.