mac操作技巧
mac 开发配置下载 vscode 编辑器地址:https://code.visualstudio.com/Downloaduniversa(普遍) Intel Chip (intel 芯片) Apple Silicon (M1 芯片)
下载 git
https://git-scm.com/download/macTim Harper 为 Git 提供了一个安装程序。最新版本是 2.33.0,发布于 4 个月前,于 2021-08-30。
安装 homebrew使用命令行安装 git
网上都是报错/bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)”
https://raw.githubusercontent.com/Homebrew/install/master/install.sh
Failed to connect to raw.githubusercontent.com port 443: Connection refused
使用下 ...
js/html/css方法
深拷贝在 JavaScript 中,深拷贝是指创建一个新的对象,并将原始对象的所有属性和嵌套对象的属性都复制到新对象中,确保原始对象和新对象之间没有引用关系。这样做可以避免在修改新对象时影响到原始对象。
以下是几种常见的 JavaScript 深拷贝方法:
手动递归复制:
123456789101112131415function deepCopy(obj) { if (typeof obj !== "object" || obj === null) { return obj; } let copy = Array.isArray(obj) ? [] : {}; for (let key in obj) { if (obj.hasOwnProperty(key)) { copy[key] = deepCopy(obj[key]); } } return copy;}
使用 JSON 序列化和反序列化:
1let copy = ...
工具/插件
浏览器同步书签同步书签
一. 配置 github token
进入 github token
填写 Note BookmarkHub
失效日期设置为No expiration
勾选gist选项
点击Generate token生成并复制 token
二. 获取 gist id
进入 gist
注:如果进入不了,需配置一下 hosts 文件C:\Windows\System32\drivers\etc\hosts在末尾添加如下内容:140.82.114.3 http://gist.github.com140.82.114.4 http://gist.github.com失败重新获取并修改 ip刷新> ipconfig /flushdns 刷新 dns
描述填写bookmarkHub
内容填写书签同步
gist 创建完成,得到 gist id
三.设置 bookmarkHub
把设置好的 github token 和 gist id 填写到 BookmarkHub 插件中
配置好上传书签
插件谷歌插件地址
C:\Users\wecy\AppData\Loca ...
Vue3.0
Vue3 学习
文档文档说明
学习地址
快速上手
vue 中文官网
代码测试
Vue3 掘金
开始创建文档
使用 vue-cli 创建123$ npm install - g @vue / cli # # 安装或者升级$ vue--version # # 保证 vue cli 版本在 4.5 .0 以上 当前安装版本5 .0 .4$ vue create my - project # # 创建项目
安装步骤注意: 选项无法按箭头键选择时, 可以用数字键选择
Use https://registry.npmmirror.com for faster installation? Yes 使用更快的 npm 镜像
Target directory D:\桌面\github\vue-3.0 already exists. Pick an action: (Usearrow keys) ** merge 文件已存在, 合并本地文件
? Please pick a preset: Default ([Vue 3] babel, eslint)**1 使用 vue3 配置项(一 ...
TypeScript
TypeScript学习
文档文档说明
学习地址
快速上手
代码测试
安装
123>npm install -g typescript 安装>tsc -v 查看版本Version 4.6.4>tsc --init 生成tsconfig.json配置文件
开始编译
新建ts文件
src/helloworld.ts
12345function greeter (person) { return 'Hello, ' + person}let user = 'Yee'console.log(greeter(user))
>tsc helloworld.ts 编译>node helloworld.js 运行 hello,Yee 打印
vscode自动编译
12345671). 生成配置文件tsconfig.json tsc --init2). 修改tsconfig.json配置 "outDir": "./js", ...
新零售项目杂记
代码片段
接口mongodb 中文文档
查询1234await MAPP.db_queryAll({ model: '', condition: {}})
获取一条数据
1234567891011121314const commodity = await MAPP.db_getOne({ model: 'commodity', condition: { _id: '58805dd61d8bdc9c56cc3e2d', distributed: { $elemMatch: { store_id: '5d64d9b75fc33f07bcfe1435' } } }, filters: { 'distributed.$:': 1 }})
不分页
12345678910111213 ...
git
git 学习
开始安装官网
初次安装 git 配置用户名和邮箱
12$ git config --global user.name "你的名称"$ git config --global user.email "你的邮箱"
git 使用 ssh 密钥
初次使用 git 的用户要使用 git 协议大概需要三个步骤:
1.生成密钥对 2.设置远程仓库(本文以 github 为例)上的公钥 3.把 git 的 remote url 修改为 git 协议
1.生成密钥对12$ cd ~/.ssh$ ls
截图本机已经生成过公钥了
文件说明:id_rsa: 公钥id_rsa.pub: 私钥
如果没有存在这个两个文件,则需要生成秘钥
12345$ssh-keygen -t rsa -C "你的邮箱"Creates a new ssh key using the provided email # Generating public/private rsa key pair.Enter file in which to save ...
文章标题教程
12345678910111213141516---title:【必需】页面标题date:【必需】页面创建日期type: 【必需】标籤、分类和友情链接三个页面需要配置updated:【可选】页面更新日期description:【可选】页面描述keywords: 【可选】页面关键字comments: 【可选】显示页面评论模块 (默认 true)top_img: 【可选】页面顶部图片mathjax: 【可选】显示 mathjax (当设置 mathjax 的 per_page: false 时,才需要配置,默认 false)katex: 【可选】显示 katex (当设置 katex 的 per_page: false 时,才需要配置,默认 false)aside: 【可选】显示侧边栏 (默认 true)aplayer: 【可选】在需要的页面加载 aplayer 的 js 和 css, 请参考文章下面的音乐 配置highlight_shrink: 【可选】配置代码框是否展开 (true/false)(默认为设置中 highlight_shrink 的配置)cover: 文章顶部图片---
...
软件
开发vscode插件
内置浏览器
教程
旧(废弃)
Live Server
Browser Preview
新
Browse Lite
内嵌浏览器
命令输入”lite” 可以找到并呼出
适合调试 vue 项目或者 web app 项目
可以调手机和 pc 模式
不足:总是有点显示不清晰
内嵌一个 debug,这个不错
Xhell天翼网盘—>软件—>开发
安装一
xshell 7xftp 7
xhell 包括两个程序(Xftp7_jb51.rar Xshell7_jb51.rar)
打开 Xshell-7.0.0109.exe 安装文件 安装路径 D:\Xshell 7
打开 Xftp-7.0.0107.exe 安装软件 安装路径 D:\Xftp 7
注意:安装完成后,将 xhell 压缩包里面有 crack 目录,将 nslicense.dll 文件覆盖到软件目录或者使用注册补丁文件,将 NetSarang.7.x.Patch.exe 复制到安装目录下运行,点击应用即可 (容易报毒)
安装二(推荐)
天翼网盘—>软件—>开发—>xhell7 ...