Content.
Code Snippets.
Field data type mapping in the dbf file of ESRI Shapefile.
{
B: 'Binary',
C: 'Character',
D: 'Date',
N: 'Numeric',
L: 'Logical',
M: 'Memo',
'@': 'Timestamp',
I: 'Long',
'+': 'Autoincrement',
F: 'Float',
O: 'Double',
G: 'OLE'
}
MediaDevices.getUserMedia()
vs <input type="file" capture />
为了使用 JavaScript 在移动终端上调用媒体设备(相机/麦克风等),H5 API 提供了 MediaDevices.getUserMedia()
,但是存在许多兼容性问题;然而,你可以使用 input
标签的 capture
属性作为备选方案。
// `accept` attribute can restrict media type.
// no accept - When the accept attribute does not exist, it will include the camera / camcorder / recorder / file system.
// accept=image/* - camera only.
// accept=video/* - camcorder only.
// accept=audio/* - recorder only.
<input type="file" capture />
@media
隐藏不需要打印的 DOM 元素@media print {
.not-print {
display: none;
}
}
标记不需要打印的 DOM 元素:
<div class="not-print"></div>
break-before
和 break-after
在打印时强制分页:.page {
break-before: auto;
break-after: always;
}
然后:
<section class="page">Page One</section>
<section class="page">Page Two</section>
CSS contain
优化性能contain: strict;
multipart/form-data
表单数据Node.js 默认对 multipart/form-data
数据在请求时不进行编码,form-data 模块提供了解决方案:
import FormData from 'form-data'
import axios from 'axios'
const formData = new FormData()
formData.append('username', username)
formData.append('password', password)
// `headers` are very important
axios.post(api, formData, { headers: formData.getHeaders() })
npm link
在 Node.js 模块/包开发中,npm link
命令可以在本地进行发布前调试,但会造成一点的问题和文件夹污染,下面提供一个更干净的方式:
"dependencies": {
"my-dev-module": "file:../my-dev-module/index.min.js"
}
node_modules 文件夹通常包含大量文件,要在 Windows 系统上删除该文件夹需要耗费很长时间,提供一个有用的命令来快速删除该文件夹:
rmdir "node_modules\" /S /Q
node-sass
安装 node-sass
的过程中总会出现网络错误,可以使用国内镜像源进行安装:
It is easy to fail to install in China in the normal way. Can be installed in the following ways:
npm i -D node-sass --sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
现在,推荐使用 sass
作为替代。
Other.
The reason this repository exists is because gistub's gist cannot be accessed in the normal way.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。