Grid 布局
Grid1234567891011<div className="container"> <div>1</div> <div>2</div> <div>3</div> <div>4</div> <div>5</div> <div>6</div> <div>7</div> <div>8</div> <div>9</div></div>
12345.container { display: grid; grid-template-columns: 33.33% 33.33% 33.33%; grid-template-rows: 33.33% 33.33% 33.33%;}
grid-template-columns 横向grid-template-rows 竖向
repeat可以使用r ...
实现 new
1234567function _new(fn){ let obj = Object.create(fn.prototype); let arg = [].slice.call(arguments,1); let res = fn.apply(obj,arg); return res instanceOf Object ? res : obj;}
vue diff 算法笔记
vue diff摘自 https://juejin.cn/post/6844903607913938951
virtual DOM 是将真实的 DOM 的数据抽取出来,以对象的形式模拟树形结构
123<div> <p>123</p></div>
对应的 js
1234var Vnode = { tag: "div", children: [{ tag: "p", text: "123" }],};
当数据发生改变时,set 方法会让调用 Dep.notify 通知所有订阅者 Watcher,订阅者就会调用 patch 给真实的 DOM 打补丁,更新相应的视图。
patch1234567891011121314151617function patch(oldVnode, vnode) { // some code if (sameVnode(oldVnode, vnode)) { patchVno ...
git Game 指令
Git 指令 10%提交记录rebase轨迹会变为线性提交
123456789# 新建并且切换到bugFixgit checkout -b bugFix# 做些提交git commit# bugFix新的提交放在master新的后面git rebase mastergit checkout master# 把master指向到bugFix最新节点git rebase bugFix
merge相比 rebase 的线性提交,merge 的提交记录为两线,最后指向同样的结尾
1234567# 新建并且切换到bugFixgit checkout -b bugFixgit commitgit merge mastergit checkout mastergit commitgit merge bugFix
HEAD分离 HEAD, 指向节点 hash 值1git checkout C4
^指向上一个提交记录
1git checkout HEAD^
移动分支可以直接使用 -f 选项让分支指向另一个提交
上面的命令会将 master 分支强制指向 HEAD 的第 3 级父提交。
1git ...
gitmoji 使用
git push --set-upstream origin V8R2C30-catalog-parent-data
gitmoji如何使用1git commit -m ":twisted_rightwards_arrows: Merge branch 'V202008A' into V202008A_wzy"
如合并V202008A分支到V202008A_wzy,:twisted_rightwards_arrows:就是 🔀,意义是合并分支
文档
gitmoji
代码
说明
🎨
:art:
改进代码结构/代码格式
💄
:lipstick:
添加或更新 UI 和样式文件
⚡️
:zap:
提高性能
🔥
:fire:
删除代码或文件
🚑
:ambulance:
关键修补程序
✨
:sparkles:
引入新功能
📝
:pencil:
编写文档
🚀
:rocket:
部署东西
🎉
:tada:
开始一个项目
✅
:white_check_mark:
添加或更新测试
🔒
:lock ...
maximum_call_stack
What happens在npm install dva-cli -g时, 出现以下情况
12345678> core-js@2.6.11 postinstall /root/.nvm/versions/node/v12.18.0/lib/node_modules/dva-cli/node_modules/babel-register/node_modules/core-js> node -e "try{require('./postinstall')}catch(e){}"sh: 1: node: Permission deniednpm ERR! Maximum call stack size exceedednpm ERR! A complete log of this run can be found in:npm ERR! /root/.npm/_logs/2020-07-07T03_12_03_141Z-debug.log
How to solve123npm config ...
再学 TypeScript
类型基础类型 null, undefined, symbol, boolean, void
12const count: number = 123const teacherName: string = 'Dell'
对象类型
1234567891011121314151617class Person {}const teacher: { name: string; age: number;} = { name: "Dell", age: 18,};const numbers: number[] = [1, 2, 3];const dell: Person = new Person();const getTotal: () => number = () => { return 123;};
type annotation and inferencetype annotation 类型注解, 我们告诉 TS 变量是什么类型
type infere ...
命令
win wsl 代理端口到 127.0.0.11netsh interface portproxy add v4tov4 listenaddress=* listenport=8071 connectaddress=127.0.0.1 connectport=8071 protocol=tcp
有线网卡无线同时使用
无线网卡 tip/ip 跃点设为 1
设置route -p add 172.0.0.0 mask 255.0.0.0 172.16.17.1 //网段 子网掩码 网关
POSTJSON1curl -H "Content-Type: application/json" -X POST -d '{"client_id": "471", "client_secret":f913bb5d5ee4878f5c45e17450250d4b}' "http://124.128.55.18:8080/devweb/api/jnswsjkw/jnsxxgzbd ...
zshrc 配置
Zinit123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 ...
Nginx安装
安装Nginx1234❯ apt install❯ apt-get update # 更新源❯ apt-get upgrade # 更新已安装的包❯ **apt** install nginx
调整防火墙123❯ ufw app listAvailable applications: OpenSSH
Simple way to add them to UFW1❯ ufw allow 80,443/tcp
Or accomplish this via application12345678910111213141516❯ vi /etc/ufw/applications.d/nginx.ini[Nginx HTTP]title=Web Serverdescription=Enable NGINX HTTP trafficports=80/tcp[Nginx HTTPS] \title=Web Server (HTTPS) \description=Enable NGINX HTTPS trafficports=443/tcp[Nginx Full]title=Web Ser ...