Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Luki committed Aug 21, 2024
1 parent 40beb51 commit 336061a
Show file tree
Hide file tree
Showing 28 changed files with 451 additions and 37 deletions.
1 change: 0 additions & 1 deletion docs/02.学习笔记/07.其他/05.浏览器兼容问题.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ author:
link: https://github.com/qq919006380
---
# 浏览器兼容
by 若愚@饥人谷

## 什么是浏览器兼容问题
同一份代码,有的浏览器效果正常,有的不正常
Expand Down
13 changes: 13 additions & 0 deletions docs/02.学习笔记/07.其他/19.opengraph.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
---
title: opengraph
date: 2023-11-07 00:00:16
permalink: /pages/840b71/
categories:
- 学习笔记
- 其他
tags:
-
author:
name: 夏天夏
link: https://github.com/qq919006380
---
## Open Graph
OG(Open Graph)协议是一种用于网页和社交媒体分享的元数据标记协议,最初由Facebook开发。它允许网站管理员指定在社交媒体上分享链接时显示的标题、描述、图片等内容,以确保分享链接的信息在各种社交媒体平台上都能被正确地显示和优化。

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: 前言
title: 设计模式-前言
date: 2022-12-20 15:39:57
permalink: /pages/23f31d/
categories:
Expand All @@ -13,6 +13,7 @@ author:
---
## 场景是基础,代码是辅助,逻辑是主角。
设计模式的核心操作是去观察你整个逻辑里面的变与不变,然后将变与不变分离,达到使变化的部分灵活、不变的地方稳定的目的。
<!-- more -->
## 主流的23种设计模式划分
- 创建型
- 单例模式
Expand Down
13 changes: 13 additions & 0 deletions docs/02.学习笔记/09.web3/01.入门.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
---
title: 入门
date: 2023-09-03 17:29:18
permalink: /pages/d82488/
categories:
- 学习笔记
- web3
tags:
-
author:
name: 夏天夏
link: https://github.com/qq919006380
---
- 知识文档
[JSON-RPC](https://ethereum.org/zh/developers/docs/apis/json-rpc)
[data解码](https://docs.soliditylang.org/en/latest/abi-spec.html)
Expand Down
13 changes: 13 additions & 0 deletions docs/02.学习笔记/09.web3/05.常见问题.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
---
title: 常见问题
date: 2023-09-03 17:29:18
permalink: /pages/d1eb3c/
categories:
- 学习笔记
- web3
tags:
-
author:
name: 夏天夏
link: https://github.com/qq919006380
---
## 常见问题
- [无法估算燃料](https://github.com/ethereum/solidity/issues/13159)
- [无法估算燃料-排查](https://blog.csdn.net/gambool/article/details/128642004)
Expand Down
13 changes: 13 additions & 0 deletions docs/02.学习笔记/09.web3/09.solidity笔记二.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
---
title: solidity笔记二
date: 2023-09-03 17:29:18
permalink: /pages/17a8da/
categories:
- 学习笔记
- web3
tags:
-
author:
name: 夏天夏
link: https://github.com/qq919006380
---
#### 函数

- 可见性修饰符(必填)
Expand Down
13 changes: 13 additions & 0 deletions docs/02.学习笔记/09.web3/10.erc6551.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
---
title: erc6551
date: 2023-09-18 16:24:20
permalink: /pages/dace16/
categories:
- 学习笔记
- web3
tags:
-
author:
name: 夏天夏
link: https://github.com/qq919006380
---
## ERC6551
为nft绑定一个账户,然后可以发送相关资产到这个账户,只有这个nft的拥有者才可以操作这个账户
## EIP 以太坊潜在新功能或流程提出建议的标准
Expand Down
13 changes: 13 additions & 0 deletions docs/02.学习笔记/09.web3/11.filcoin.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
---
title: filcoin
date: 2023-09-30 21:57:11
permalink: /pages/d74048/
categories:
- 学习笔记
- web3
tags:
-
author:
name: 夏天夏
link: https://github.com/qq919006380
---
[fil区块链浏览器](https://filscan.io/#/home)
[filecoin官网](https://filecoin.io/zh-cn/)
[filecoin文档](https://docs.filecoin.io/)
Expand Down
13 changes: 13 additions & 0 deletions docs/02.学习笔记/09.web3/12.web3钱包类型.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
---
title: web3钱包类型
date: 2023-10-25 00:30:57
permalink: /pages/db3733/
categories:
- 学习笔记
- web3
tags:
-
author:
name: 夏天夏
link: https://github.com/qq919006380
---
# 钱包类型

## EOA (Externally Owned Account) 帐号:
Expand Down
13 changes: 13 additions & 0 deletions docs/02.学习笔记/09.web3/13.4337.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
---
title: 4337
date: 2023-10-24 21:34:13
permalink: /pages/f8b5d6/
categories:
- 学习笔记
- web3
tags:
-
author:
name: 夏天夏
link: https://github.com/qq919006380
---
## 智能合约钱包(4337)
- UserOperations 用户操作对象,是用于与合约账户执行交易的伪交易对象。这些是由创建者的应用程序所创建的。
- Bundlers 捆绑器,可能是某个矿工,从内存池中打包 UserOperations 并将它们发送到区块链上的 EntryPoint 合约的参与者。
Expand Down
13 changes: 13 additions & 0 deletions docs/02.学习笔记/09.web3/14.TheGraph区块链索引.md
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
---
title: TheGraph区块链索引
date: 2023-10-30 14:31:35
permalink: /pages/1495b0/
categories:
- 学习笔记
- web3
tags:
-
author:
name: 夏天夏
link: https://github.com/qq919006380
---
[The Graph入门教程:如何索引合约事件](https://learnblockchain.cn/article/2466)
13 changes: 13 additions & 0 deletions docs/02.学习笔记/09.web3/15.跨链桥.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
---
title: 跨链桥
date: 2024-01-10 14:53:52
permalink: /pages/07a08d/
categories:
- 学习笔记
- web3
tags:
-
author:
name: 夏天夏
link: https://github.com/qq919006380
---
[ccip视频 介绍](https://www.youtube.com/watch?v=uAdjzTtDOnQ)

## 跨链桥产品
Expand Down
14 changes: 14 additions & 0 deletions docs/02.学习笔记/09.web3/16.foundry框架.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
---
title: foundry框架
date: 2024-04-04 18:10:37
permalink: /pages/a48e2e/
categories:
- 学习笔记
- web3
tags:
-
author:
name: 夏天夏
link: https://github.com/qq919006380
---
## foundry
- (官方文档)[https://book.getfoundry.sh/]
- (中文文档)[https://learnblockchain.cn/docs/foundry/i18n/zh/index.html]
<!-- more -->

## forge
- 用于编译、测试和部署智能合约
Expand Down
13 changes: 13 additions & 0 deletions docs/02.学习笔记/10.react/01.入门.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
---
title: 入门
date: 2023-09-18 09:04:43
permalink: /pages/bcbe54/
categories:
- 学习笔记
- react
tags:
-
author:
name: 夏天夏
link: https://github.com/qq919006380
---
## useEffect

## return
Expand Down
15 changes: 15 additions & 0 deletions docs/_posts/笔记/AI.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
---
title: 虚拟主播AI信息收集
date: 2023-12-29 13:05:03
permalink: /pages/de62db/
sidebar: auto
categories:
- 笔记
tags:
-
author:
name: 夏天夏
link: https://github.com/qq919006380
---

## TTS
[google](https://cloud.google.com/solutions/ai?hl=zh-CN)
[AI Vtuber](https://www.cnblogs.com/ikaros-521/p/17746640.html)
[resemble.ai](https://www.resemble.ai/)
Expand Down
3 changes: 0 additions & 3 deletions docs/_posts/笔记/brc20.md

This file was deleted.

88 changes: 82 additions & 6 deletions docs/_posts/笔记/cli笔记.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,83 @@
require加载资源策略
1,只能加载js,json,node.exe,.node文件
2,如果是其他后缀入md,txt则当js引入,如果文件内不是js内容则报错
---
title: cli笔记
date: 2021-06-24 15:07:13
permalink: /pages/14a471/
sidebar: auto
categories:
- 笔记
tags:
-
author:
name: 夏天夏
link: https://github.com/qq919006380
---
## Node.js 中的资源加载策略与模块导入

node使用import
1,使用webpack打包编译
2,node14以上版本原生支持,不过js结尾改成mjs入xxx.mjs
在 Node.js 开发中,处理资源文件和模块导入的策略非常重要,尤其是在使用不同的文件后缀和加载机制时。本文将探讨在 Node.js 环境中如何加载特定类型的资源文件,并介绍使用 require 和 import 的方法及其对应的策略。

## 资源加载策略

在 Node.js 中,使用 require 加载资源时,有一些文件类型是默认支持的,而其他类型的文件可能需要特定的处理策略:

## 支持的文件类型

- .js:JavaScript 文件。
- .json:JSON 文件。
- .node:Node.js 的原生扩展模块文件(通常是 C++ 编写的二进制文件)。

## 处理其他文件类型

对于 .md 和 .txt 等其他后缀文件,默认情况下 require 不会直接加载这些文件。如果需要加载这些文件作为 JavaScript 文件,你需要进行特殊处理。

策略:当尝试 require 这些文件时,可以将其内容作为 JavaScript 模块进行处理。如果文件内容不是有效的 JavaScript,则需要抛出错误。

```javascript
const fs = require("fs");
const path = require("path");

function loadFile(filePath) {
const ext = path.extname(filePath);

if ([".js", ".json", ".node"].includes(ext)) {
return require(filePath);
} else if ([".md", ".txt"].includes(ext)) {
const content = fs.readFileSync(filePath, "utf-8");
try {
// 尝试将内容作为 JavaScript 执行
return eval(content);
} catch (e) {
throw new Error(`Error evaluating content of ${filePath}: ${e.message}`);
}
} else {
throw new Error(`Unsupported file type: ${ext}`);
}
}
```

## Node.js 中的模块导入

在 Node.js 中,使用 import 语法可以实现 ES6 模块导入,这为开发者提供了更现代化的模块管理方式。根据 Node.js 的版本和配置,import 的支持情况有所不同:

## Webpack 打包编译

在使用 Webpack 时,你可以通过配置将 ES6 模块(.js 文件)打包成兼容的格式。Webpack 支持将 import 语法转换为 CommonJS 格式,这使得在 Node.js 环境中使用 import 成为可能。

## Node.js 14 及以上版本原生支持

从 Node.js 14 开始,原生支持 ES6 模块。你可以直接使用 import 语法,但文件后缀名需要改为 .mjs,以明确标识这是一个 ES6 模块。如果你希望使用 .js 文件作为模块,你需要在项目的 package.json 文件中添加 "type": "module" 字段,这样 Node.js 会将 .js 文件视作 ES6 模块。

```javascript
// 使用 import 语法导入模块
import myModule from "./myModule.mjs";
```

```json
// package.json 中的配置
{
"type": "module"
}
```

## 总结

在 Node.js 中处理不同文件类型和模块导入时,需要根据使用的文件类型和 Node.js 版本选择合适的策略。使用 require 加载特定文件类型时,需要针对不常见的文件类型编写额外的处理逻辑。而在使用 ES6 模块时,确保你的 Node.js 环境和文件配置支持 import 语法,以便充分利用现代模块化的优势。
13 changes: 13 additions & 0 deletions docs/_posts/笔记/docker.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
---
title: docker
date: 2023-11-28 13:59:17
permalink: /pages/9d7bcc/
sidebar: auto
categories:
- 笔记
tags:
-
author:
name: 夏天夏
link: https://github.com/qq919006380
---
# 1. 管理 Docker 镜像

## 列出镜像:
Expand Down
13 changes: 13 additions & 0 deletions docs/_posts/笔记/electron.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
---
title: electron
date: 2021-10-23 14:33:20
permalink: /pages/63fbe3/
sidebar: auto
categories:
- 笔记
tags:
-
author:
name: 夏天夏
link: https://github.com/qq919006380
---
[将已经做好的vue项目打包成c/s架构](https://www.cxyzjd.com/article/qq_41579104/107340431)


Expand Down
13 changes: 13 additions & 0 deletions docs/_posts/笔记/harbor.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
---
title: harbor
date: 2023-12-14 18:55:08
permalink: /pages/18402f/
sidebar: auto
categories:
- 笔记
tags:
-
author:
name: 夏天夏
link: https://github.com/qq919006380
---
https://goharbor.io/docs/2.0.0/install-config/configure-https/
https://goharbor.io/docs/2.0.0/install-config/troubleshoot-installation/#https
Loading

0 comments on commit 336061a

Please sign in to comment.