解决macOS下VS Code启动时报错的问题
解决macOS下VS Code启动时报错的问题问题复现MAC升级到macOS Monterey,每次重启电脑之后打开VS Code,右下角都有一个错误弹窗:Unable to resolve your shell environment in a reasonable time. Please review your shell configuration.
而且重启电脑后,打开terminal时,也有很长时间卡住的现象(这时zsh的标题窗口一直卡在xcodebuild上)
解决问题由于terminal卡在xcodebuild上,推断是系统升级后xcode的问题,百度了一番,说是内置git的问题,解决方案如下:
通过homebrew安装git
1brew install git
编辑.zshrc,将新装的git路径加入PATH中
1vim ~/.zshrc
.zshrc文件内容如下:
123456789101112131415export ZSH="/Users/williampeng/.oh-my-zsh"ZSH_DISABLE_COMPFIX=" ...
在电脑上下载Google Play上的APP安装包
在电脑上下载Google Play上的APP安装包
开启翻墙软件
访问https://apkpure.com
搜索要下载的APP
下载apk文件
使用nodejs编写cli(命令行)
使用nodejs编写cli(命令行)背景在之前的开发中,使用过vue-cli等命令行工具生成项目模板,极大地方便了日常工作的展开。但是有时候一些十分特别的需求,我们是找不到适合的cli工具去做的。比如说,在同一个后端鉴权逻辑下,登录等功能是一样的,前端项目可能采用Vant、ElementUI、AntDesign、AntDesign Mobile等,目前npm仓库中现有的cli工具基本都不会涉及业务逻辑,即使对业务很熟悉,每次新建项目要处理起登录逻辑来也是要改很多文件的。所以呢,何不为自己项目写一个cli?就专门做这些繁琐的活?
项目实战声明入口,安装依赖
修改package.json,添加一个bin字段,bin字段里面写上这个命令行的名字,也就是vite-helper-cli,它告诉node,里面的js脚本可以通过命令行的方式执行,以vite-helper-cli的命令调用。
chalk.js可以为console.log()的输出信息配置不同的显示颜色和样式
execa 相对于内置的 Node.js child_process 模块来说,execa 公开了一个基于 promise 的 ...
MacOS下部分App多语言切换
MacOS下部分App多语言切换在终端执行以下命令后,重新打开App即可
1234567891011# sketch切换为中文defaults write com.bohemiancoding.sketch3 AppleLanguages '(zh-CN)'# 喵影工厂切换为中文defaults write com.wondershare.filmoramac AppleLanguages '(zh-CN)'# sketch切换为英文defaults write com.bohemiancoding.sketch3 AppleLanguages '(en-US)'# 喵影工厂切换为英文defaults write com.wondershare.filmoramac AppleLanguages '(en-US)'
Vite2.x + React + TS起步
Vite2.x + react 18.x + TS起步创建项目
Requires Node.js ^14.17.0, 16.0.0 or later. 因为部分依赖在低版本node中不兼容
1234yarn create vite vite-react --template react-tscd vite-reactyarnyarn dev
修改语法检查与格式化配置
安装依赖
1yarn add eslint eslint-plugin-react eslint-plugin-react-hooks @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-config-airbnb-base eslint-plugin-import vite-plugin-eslint -D
修改.eslintignore文件
1234/dist//*.js/*.zip/*.rar
修改.eslintrc.js文件
1234567891011121314151617181920212223242526272829303 ...
Vite2.x + Vue.js3.x + TS起步
Vite2.x + Vue.js3.x + TS起步创建项目
Requires Node.js ^14.17.0, 16.0.0 or later. 因为部分依赖在低版本node中不兼容
1234yarn create vite vite-project --template vue-tscd vite-projectyarnyarn dev
修改语法检查与格式化配置
安装依赖
Requires vue-eslint-parser 9.0.0 or later.
1yarn add eslint eslint-plugin-vue vue-eslint-parser @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-config-airbnb-base eslint-plugin-import vite-plugin-eslint -D
修改.eslintignore文件
1234/dist//*.js/*.zip/*.rar
修改.eslintrc.js文件
12345678910111 ...
解决Xcode真机调试不兼容高版本iOS问题
解决Xcode真机调试不兼容高版本iOS问题
从Gitee下载手机系统对应版本的兼容包;
解压下载的压缩包;
关闭Xcode;
依次进入以下文件夹: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/;
将解压的文件夹移动到该目录;
重新打开Xcode.
APP审核被拒,使用了私有API(Guideline 2.5.1)
APP审核被拒,使用了私有API问题现象收到邮件,提示使用了私有API
Your app uses or references the following non-public APIs:com.apple.springboard.lockcompleteThe use of non-public APIs is not permitted on the App Store because it can lead to a poor user experience should these APIs change.Continuing to use or conceal non-public APIs in future submissions of this app may result in the termination of your Apple Developer account, as well as removal of all associated apps from the App Store.
解决方法如果不确定是哪个第三方使用了私有API,那就先搜索下
12c ...
解决macOS升级导致git命令报错
解决macOS升级导致git命令报错问题复现今天心血来潮想要尝试一下Monterey的实况文本,所以对Mac电脑进行系统升级,在等待了1个多小时后,终于升级到新版本,打开图片一顿操作,发现对中文的支持还是有点不尽人意. 算了,好好写代码吧,接着打开自己的VSCode准备突突突写代码,然而现实给我当头棒喝,git直接用不了QAQ
1xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
解决办法重新安装xcode-select
1xcode-select --install
如果重新安装完还不行的话,执行以下命令重置下:
1sudo xcode-select --reset
用CSS切换横竖屏显示
用CSS切换横竖屏显示今天接到个需求,页面中的部分元素需要放大到全屏显示,并且是横屏方向显示,类似于支付宝中股票K线图的样式.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style type="text/css"> body{ margin: 0; } .wrapper { width: 100%; height: ...
