Skip to content

Instantly share code, notes, and snippets.

View Lxxyx's full-sized avatar

Lxxyx Lxxyx

  • China Hangzhou (UTC+8)
  • 12:58 (UTC +08:00)
View GitHub Profile
const fs = require('fs')
const path = require('path')
const {
exec
} = require('child_process')
const file = process.argv[2]
const filename = file.split('.')[0]
if (!file) {
@Lxxyx
Lxxyx / text.md
Last active August 13, 2017 03:36
text readme
@Lxxyx
Lxxyx / interview.md
Created February 27, 2018 04:11
interview

知识图谱:

  1. HTML/CSS 基本知识
  2. HTML/CSS 常见布局(Flex布局)
  3. HTML5/CSS3 新增内容
  4. React + 底层原理 + 性能优化 + 高阶组件 + Redux
  5. JavaScript模块化 + cmd/umd/es6 import + React中的使用
  6. Microtask + Macrotask,事件循环
  7. 移动端页面适配-REM
  8. Vue,底层原理,周边生态
@Lxxyx
Lxxyx / example.js
Created June 6, 2018 07:28
重构例子
// ================你写的==================
/**
*
* @param {String, Object} message
* @param {Enum} position
*/
const showToast = (message, position = 'middle') => {
let iconClass = ['nbsicon']
// 根据message类型处理iconCLass
let msg = ''
@Lxxyx
Lxxyx / scheduler.js
Created November 29, 2018 18:57
scheduler 源码笔记
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
/* eslint-disable no-var */
@Lxxyx
Lxxyx / fps.js
Created December 7, 2018 05:50
fps
function detectFpsInPeriod(options) {
const now = () => performance.now()
const startTime = now()
let lastOutputTime = now();
let frameCount = 0;
const fpsResult = []
let stoped = false;
function getFps() {
@Lxxyx
Lxxyx / cloudSettings
Last active July 30, 2020 04:48
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-07-30T04:48:13.159Z","extensionVersion":"v3.4.3"}
@Lxxyx
Lxxyx / demo.ts
Last active February 23, 2021 10:52
hooks test demo
import { get, post } from '../demo'
import {
createApp,
HooksApplication
} from '@midwayjs/mock'
// 纯函数
test('pure function', () => {
const result = pureFunction()
expect(result).toEqual('pure')
@Lxxyx
Lxxyx / api-config.ts
Last active March 15, 2021 11:03
Hooks 中间件设计
export const config = {
middleware: [
async (next) => {
const ctx = useContext()
ctx.name = ctx.request.body.name
await next()
}
]
}