React 流行以后,编写前端组件的成本变得非常低廉,开发一个通用组件是件非常容易的事,日常业务开发也早已变成搭积木式的堆组件了。在这种开发环境下组件的可用性就变得至关重要,谁都希望拿在手的组件可以像橡皮泥一样”任人摆布“,“放之四海皆准”,而不是动不动就要去改源码。
高可用包含两层意思,
一是开发时的高可用,一处编码,处处可用
二是用户群体的高可用,正常用户行为可用,特殊用户行为也可用。
const mondayFirstWeekDay = day => (day + 7) % 8 | |
const isWeekend = date => !!Math.floor(mondayFirstWeekDay(date.getDay()) / 6) |
export const NORMAL_RULE = 1 | |
export const WEEKDAY_RULE = 2 | |
export const WEEKEND_RULE = 3 | |
export const getRuleTypeByDate = ms => Math.ceil(new Date(ms).getDay() / 5) + 1 | |
export const typeMap = { | |
[NORMAL_RULE]: '不区分常规休息日', | |
[WEEKDAY_RULE]: '常规', | |
[WEEKEND_RULE]: '休息日' |
ctrl
-opt
-cmd
-p
开启直通模式opt
-tab
— BEGIN LICENSE —– | |
ZYNGA INC. | |
50 User License | |
EA7E-811825 | |
927BA117 84C9300F 4A0CCBC4 34A56B44 | |
985E4562 59F2B63B CCCFF92F 0E646B83 | |
0FD6487D 1507AE29 9CC4F9F5 0A6F32E3 | |
0343D868 C18E2CD5 27641A71 25475648 | |
309705B3 E468DDC4 1B766A18 7952D28C | |
E627DDBA 960A2153 69A2D98A C87C0607 |
module.exports = { | |
environments: ['browser'], | |
globals: ['Pagckage', 'Npm'], | |
namedExports: { | |
underscore: ['omit', 'debounce', 'memoize', 'groupBy'] | |
}, | |
groupImports: true, | |
sortImports: true, | |
danglingCommas: false, | |
stripFileExtensions: ['.js', '.jsx', '.ts', '.tsx', '.vue'], |
By default, Emmet disable Tab
key works at text.html
scope,
so Tab
key just work in a whitelist of the know html tags.
To enable Emmet for Vue syntax in Sublime Text, we can exclude the
text.html.vue
form text.html
scope in our user Emmet setting:
{
"disabled_single_snippet_for_scopes": "text.html - text.html.vue"
}
const dgram = require('dgram'); | |
const serverSocket = dgram.createSocket('udp4'); | |
const multicastAddress = '224.0.0.50'; | |
const multicastPort = 4321; | |
const serverPort = 9898; | |
var AqaraAccessoryFactory; | |
function startServer() { |
通过在 Mac OSX 的 Automator 上创建一个 “快速操作” 可以为浏览器添加一个自定义的右键菜单命令。
再利用脚本去更新对应文件就可以实现 css 版本的快速更新了。