收集编程解决方案-husagi记录

  • 【Git教程】如何清除git仓库的所有提交记录,成为一个新的干净仓库
    一、相关教程 【GIT教程】清除git仓库中某个文件的提交记录 二、背景 最近把一些项目传到Github上面进行开源。其中某些项目开发了一两年时间
  • Global CSS cannot be imported from within node_modules
    假如报的是antd-mobile的错误 ,需要在next.config.js中配置:const withTM = require('next-transpile-modules')([  'antd-mobile']);
  • vite 使用.env文件区分环境
    根目录新建 .env.development 文件NODE_ENV = developmentVITE_APP_ENV = dev .env.production 文件NODE_ENV = productionVITE_APP_ENV = production 配置package.json"scripts": {    "dev": "vite
  • antd table 自定义行的样式
    使用rowClassName来特别标识<Table        components={components}        rowClassName={(record, index) => {          return (  &nbsp
  • golang使用text-template生成代码
    基于 text/template 标准库进行示例代码:tpl, err := template.ParseFiles(tplPath)    if err != nil {        panic(err)    }file, err := os.OpenFile(“./test.go”,
  • css 使用@property 给渐变色添加过渡效果
    @property --houdini-colorA {  syntax: '<color>';  inherits: false;  initial-value: #fff;}@property --houdini-colorB {  syntax: '<color>';  inherits: false;  i
  • css 自定义li的样式
    使用emoji@counter-style circled-alpha {  system: fixed;  symbols: 😀 😄 😁 😆 😅 😂 🤣 😊 😇 🙂 🙃 😉 😌 😍 🥰 😘 😗 😙 😚 😋 😛 😝 😜 🤪 🤨;  suffix: " ";}li {   list-style: circled-alpha;}
  • The engine “node“ is incompatible with this module. Expected version问题解决
    yarn config set ignore-engines true
  • npm version 命令
    通过npm version命令,可自动按规则更改这个版本。再也不用去package.json手动修改保存了!当要发补丁版时可运行命令:npm version patch当要发小版本时可运行命令:npm version minor当要发大版本时可运行命令:npm version major
  • vue2 使用lodash进行防抖处理
    import lodash from "lodash"methods:{    handleFunc: lodash.debounce(function(){        // dosomething    },200)}
  • yarn : 无法加载文件 因为在此系统因为在此系统上禁止运行脚本
    1、在windows搜索powershell,右键以管理员身份运行2、在本地计算机上运行您编写的未签名脚本和来自其他用户的签名脚本,使用以下命令将计算机上的 执行策略更改为 RemoteSigned3、执行 set-ExecutionPolicy RemoteSigned 选择Y4、再次使用yarn
  • h5适配ios顶部和底部安全区域的问题
    一. 前言: 苹果手机从iphoneX之后,屏幕顶部都有一个齐刘海,iPhoneX 取消了物理按键,改成底部小黑条,如果不做适配,这些地方就会被遮挡,所以本文记录一下齐刘海与底部小黑条的适配方法。 二. 知识点学习 1)viewport-fit iOS11 新
  • electron 安装失败
    安装electron项目依赖失败的时候,删除node_modules后执行一下命令npm i --ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/
  • MongoDB在Aggregate中$limit与$skip位置变化的影响MongoDB在Aggregate中$limit与$skip位置变化的影响
    数据准备{ "_id" : ObjectId("5bdac3aa370b331d24e7fbc2"), "value" : 1 }{ "_id" : ObjectId("5bdac3d7370b331d24e7fbc5"), "value" : 2 }{ "_id" : Objec
  • golang time.Parse 转时间戳多8小时
    time使用utc time.Parse 换为time.ParseInLocation
  • nuxt3 generate 构建静态项目
    nuxt.config.ts中export default defineNuxtConfig({  generate:    routes: ["/p/1","/p/2"]  },}) routes后面根据自己项目情况添加动态页面路由,可从后台调用接口获取拼接为array执行nuxt build在output中得到目录,使用nginx 代
  • 史上最详细Docker安装Redis (含每一步的图解)实战
    不仅教你安装,还教你删除。 每一行命令都带图解,绝对能懂。 大家对搭建Redis Clustr (Redis 集群)感兴趣的,可以看看这篇文章 Docker搭建Redis Cluster集群环境 希望对大家有所帮助 一、Docker搜索redis镜像 命令:docker search <镜像名称> docker search redis 可以看
  • docker安装es安装es 安装es_head
    安装es 1,下载镜像:docker pull elasticsearch:7.12.0 2,创建映射文件夹 3,在config文件夹下创建 elasticsearch.yml文件 内容:http.host: 0.0.0.0注意此处冒号有空格 4,文件授权 chmod -R 777 /home/mappingdata/es/ 5,启动 docker run --name e
  • golang 单引号 双引号 反引号区别
    单引号,表示byte类型或rune类型,对应 uint8和int32类型,默认是 rune 类型。byte用来强调数据是raw data,而不是数字;而rune用来表示Unicode的code point。双引号,才是字符串,实际上是字符数组。可以用索引号访问某字节,也可以用len()函数来获取字符串所占的字节长度。反引号,表示字符串字面量,但不支持任何转义序列。字面量 raw literal
  • nuxt3自定义错误页面
    nuxt3中自定义错误页面是在根目录下(与app.vue同级)创建error.vuenuxt2.x是在layout下创建error.vue