Skip to content

Instantly share code, notes, and snippets.

Avatar
🌴
On vacation

i18u iahu

🌴
On vacation
  • cn
View GitHub Profile
@iahu
iahu / answer.md
Last active Aug 10, 2020
附加题
View answer.md
  1. n^2
  2. 在 UTF-8 编码规范中,8 个 character 组成的编号代表一个 byte,每个 character 以 0 或 1 表示。string 是一组 byte 或 character。 一个字符以 8 个 byte character 代表。 Unicode 是一种文字编码方案,目的是为了统一表示全球所有文字符号。UTF-8, UTF-16, GB2312 和 GB18030 是 Unicode 的几个具体实现
  3. iOS/MacOS
  • iOS 下的微信,在登录了电脑版后,没有一个智能判断用户目前在哪个设备上活跃,而把消息通知只发到那个平台上
  • iOS 下的 Twitter,没有浏览记录,如果回想起某条推文很难再找到
View is-weekend.js
const mondayFirstWeekDay = day => (day + 7) % 8
const isWeekend = date => !!Math.floor(mondayFirstWeekDay(date.getDay()) / 6)
@iahu
iahu / helper.js
Last active Jun 23, 2020
use es6 destructuring assignment to reduce logic control (the if else statement)
View helper.js
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]: '休息日'
@iahu
iahu / .importjs.js
Last active Nov 26, 2020
importjs use webpack alias
View .importjs.js
const path = require('path')
const webpackConfig = require('./webpack.config.production')
const aliaes = webpackConfig.resolve.alias
const aliaesKeys = Object.keys(aliaes)
const aliaesValues = Object.values(aliaes)
const getAliasKey = (aliaesValues, folderModule) => {
let aliasKey = ''
aliaesValues.some((v, i) => {
View ipadOS-full-keyboard-access.md
  • 在连接蓝牙键盘的情况下在触摸屏上调出软键盘:长按屏幕右下角(输入法工具栏最右边)的箭头
  • 开启全键盘控制后用上下键控制 Safari 滚动:按 ctrl-opt-cmd-p 开启直通模式
  • Safari 下开启 tabIndex 导航: opt-tab
View subl.key
— 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
@iahu
iahu / .importjs.js
Created May 14, 2020
importjs config file
View .importjs.js
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'],
@iahu
iahu / README.md
Created May 9, 2020
Enable Emmet Tab key for Vue syntax in Sublime Text
View README.md

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"
}
@iahu
iahu / README.md
Created Jul 17, 2019
通过 AppleScript 实现快速更新 iconfont.cn 网站 css 版本更新
View README.md
  1. 通过在 Mac OSX 的 Automator 上创建一个 “快速操作” 可以为浏览器添加一个自定义的右键菜单命令。

  2. 再利用脚本去更新对应文件就可以实现 css 版本的快速更新了。

@iahu
iahu / Default(OSX).sublime-keymap
Created Jul 17, 2019
Sublime Text 通过 RegReplace 实现对 Mock.js 到 TypeScript 类型声明语句的自动转换
View Default(OSX).sublime-keymap
// 绑定/修改 快捷键
[
{ "keys": ["super+v"], "command": "chain",
"args": {
"commands": [
["paste"],
["reg_replace", {"replacements": ["mock_to_number", "mock_to_string", "fix_key_argument", "fix_array_type"]}]
]
},
"context": [
You can’t perform that action at this time.