首页
📷在线壁纸
🎬娱乐天地
🔖友情链接
更多
📝留言板
Search
1
【javascript】JS-向当前url追加参数
2,345 阅读
2
【PHP】生成随机昵称
2,219 阅读
3
【PHP】判断一个字符串是否属于序列化后的数据
2,024 阅读
4
【css】html+css给文章页,做阅读全文
1,975 阅读
5
【PHP】 设计模式(23种)
1,910 阅读
📂默认分类
💓typecho
🏳️🌈代码改变世界
🍇 mysql
🍈 Winform
🍓 golang
🍉 设计模式
🥝 PHP
🍎 python
🍊 nginx
🍋 网络安全
🍍 javascript
🫑 database
🍭文艺范
🍏mac
AI
LLM
image
audio
yolo
3D
code
登录
Search
标签搜索
php
typecho
代码注释
redis
mysql
go
golang
nginx
thinkphp
docker
gin
linux
curl
html
mamp
算法
短网址
构造函数
webhook
代码片段
依然范儿特西
累计撰写
145
篇文章
累计收到
1
条评论
首页
栏目
📂默认分类
💓typecho
🏳️🌈代码改变世界
🍇 mysql
🍈 Winform
🍓 golang
🍉 设计模式
🥝 PHP
🍎 python
🍊 nginx
🍋 网络安全
🍍 javascript
🫑 database
🍭文艺范
🍏mac
AI
LLM
image
audio
yolo
3D
code
页面
📷在线壁纸
🎬娱乐天地
🔖友情链接
📝留言板
搜索到
145
篇与
的结果
2021-10-25
GoDoc的使用
一. 约定注释符//后面要加空格, 例如: // xxx在 package, const, type, func等关键字上面并且紧邻关键字的注释才会被展示// 此行注释被省略 // 此行注释被展示 // // 此行注释被展示2 package bananatype, const, func以名称为注释的开头, package以Package name为注释的开头// Package banana ... package banana // Xyz ... const Xyz = 1 // Abc ... type Abc struct {} // Bcd ... func Bcd() {}有效的关键字注释不应该超过3行// Package banana ... // ... // ... // 最好不要超过三行 package bananaPackage的注释如果超过3行, 应该放在当前包目录下一个单独的文件中, 如:doc.go如果当前包目录下包含多个Package注释的go文件(包括doc.go), 那么按照文件名的字母数序优先显示//----- doc.go ----- /* ...第一个显示 */ package banana//----- e.go ----- // Package banana ...第二个显示 package banana//----- f.go ----- // Package banana ...第三个显示 package bananaPackage的注释会出现在godoc的包列表中, 但只能展示大约523字节的长度在无效注释中以BUG(who)开头的注释, 将被识别为已知bug, 显示在bugs区域, 示例// BUG(who): 我是bug说明 // Package banana ... package banana9.如果bug注释和关键字注释中间无换行, 那么混合的注释将被显示在bugs和godoc列表两个区域内// BUG(who): 我是bug注释 // Package banana ...也是pkg注释 package banana段落:/* abc ... bcd Basic(字体加粗变蓝需首字母大写, 中文加粗变蓝需要加上一个大写字母) abc ... ... 属于Basic的段落 ... bcd */ package banana预格式化:/* abc ... bcd Abc(不会加粗变蓝, 预格式化和段落不能同时存在) abc ... 预格式化需要缩进 ... bcd */12.URL将被转化为HTML链接二. Example文件必须放在当前包下文件名以example开头, _连接, test结尾, 如:example_xxx_test.go包名是当前包名 + _test, 如: strings_test函数名称的格式func ExampleFuncName()函数注释会展示在页面上函数结尾加上// Output:注释, 说明函数返回的值// 文件必须放在 banana包目录下, 名字必须为example_xxx_test.go // Package banana_test 为banana包的示例 package banana_test // 此注释将会被展示在页面上 // 此函数将被展示在OverView区域 func Example() { fmt.Println("Hello OverView") // Output: // Hello OverView } // 此函数将被展示在OverView区域, 并展示noOutput标签 func Example_noOutput() { fmt.Println("Hello OverView") // (Output: )非必须, 存在时将会展示输出结果 } // 此函数将被展示在Function区域 // Peel必须是banana包实现的方法 func ExamplePeel() { fmt.Println("Hello Banana") // Output: // Hello Banana } // 此函数将被展示在Function区域 // Peel必须是banana包实现的方法, 并展示big标签 func ExamplePeel_big() { fmt.Println("Hello Banana") // Output: // Hello Banana } 三. Command line安装 godocgo get -v golang.org/x/tools/cmd/godoc开启一个godoc小型server,# 6060是godoc提供的默认端口 # 方式一 godoc -http=:6060 # 方式二 : -play可以使用playground运行Example代码 godoc -http=:6060 -play 查看自己的项目文档# mygoweb 为自己项目的mod里的名字 http://127.0.0.1:6060/pkg/mygoweb/
2021年10月25日
167 阅读
0 评论
1 点赞
2021-10-22
Docker php安装扩展步骤详解
前言此篇,主要是演示docker-php-source , docker-php-ext-install ,docker-php-enable-docker-configure 这四个命令到底是用来干嘛的,它们在PHP容器中都做了哪些事情。很多人很不理解在Dockerfile中安装PHP扩展的时候总是出现这几个命令,本篇就就是为你揭开这些命令的神秘面纱而准备的,所有案例都是本人自己运行过的。Docker 中的PHP容器安装扩展的方式有通过pecl方式安装通过php 容器中自带的几个特殊命令来安装,这些特殊命令可以在Dockerfile中的RUN命令中进行使用。这里,我们主要讨论的是第二种方案,如何通过PHP容器中的几个特殊命令来安装PHP扩展PHP中安装扩展有几个特殊的命令docker-php-sourcedocker-php-ext-installdocker-php-ext-enabledocker-php-ext-configure演示这三个命令的作用都是在PHP容器中进行演示的,PHP容器启动太简单,不作过多介绍docker-php-source此命令,实际上就是在PHP容器中创建一个/usr/src/php的目录,里面放了一些自带的文件而已。我们就把它当作一个从互联网中下载下来的PHP扩展源码的存放目录即可。事实上,所有PHP扩展源码扩展存放的路径: /usr/src/php/ext 里面。格式:docker-php-source extract | delete参数说明:extract : 创建并初始化 /usr/src/php目录delete : 删除 /usr/src/php目录案例:root@richerdyoung.com:/usr/src# ls -l total 11896 #此时,并没有php目录 -rw-r--r-- 1 root root 12176404 Jun 28 03:23 php.tar.xz -rw-r--r-- 1 root root 801 Jun 28 03:23 php.tar.xz.asc root@richerdyoung.com:/usr/src# docker-php-source extract root@richerdyoung.com:/usr/src# ls -l total 11900 #此时,生产了php目录,里面还有一些文件,由于篇幅问题,就不进去查看了 drwxr-xr-x 14 root root 4096 Aug 9 09:01 php -rw-r--r-- 1 root root 12176404 Jun 28 03:23 php.tar.xz -rw-r--r-- 1 root root 801 Jun 28 03:23 php.tar.xz.asc root@richerdyoung.com:/usr/src# docker-php-source delete root@richerdyoung.com:/usr/src# ls -l total 11896 #此时,将已创建 php 目录给删除了 -rw-r--r-- 1 root root 12176404 Jun 28 03:23 php.tar.xz -rw-r--r-- 1 root root 801 Jun 28 03:23 php.tar.xz.asc root@richerdyoung.com:/usr/src#docker-php-ext-enable这个命令,就是用来启动 PHP扩展 的。我们使用pecl安装PHP扩展的时候,默认是没有启动这个扩展的,如果想要使用这个扩展必须要在php.ini这个配置文件中去配置一下才能使用这个PHP扩展。而 docker-php-ext-enable 这个命令则是自动给我们来启动PHP扩展的,不需要你去php.ini这个配置文件中去配置。案例 # 查看现有可以启动的扩展 root@richerdyoung.com:/usr/local/etc/php# ls /usr/local/lib/php/extensions/no-debug-non-zts-20170718/ opcache.so redis.so sodium.so root@richerdyoung.com:/usr/local/etc/php# # 查看redis 扩展是否可以启动 root@richerdyoung.com:/usr/local/etc/php# php -m | grep redis root@richerdyoung.com:/usr/local/etc/php# # 启动 redis 扩展 root@richerdyoung.com:/usr/local/etc/php# docker-php-ext-enable redis # 启动 成功 root@richerdyoung.com:/usr/local/etc/php# php -m | grep redis redis root@richerdyoung.com:/usr/local/etc/php# #说明,php容器中默认是没有php.ini配置文件的,加载原理如下所示 root@richerdyoung.com:/usr/local/etc/php# php -i | grep -A 5 php.ini Configuration File (php.ini) Path => /usr/local/etc/php Loaded Configuration File => (none) # 核心是 /usr/local/etc/php/conf.d 目录下的扩展配置文件 Scan this dir for additional .ini files => /usr/local/etc/php/conf.d Additional .ini files parsed => /usr/local/etc/php/conf.d/docker-php-ext-redis.ini, /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini root@richerdyoung.com:/usr/local/etc/php#docker-php-ext-install这个命令,是用来安装并启动PHP扩展的。命令格式:docker-php-ext-install 源码包目录名注意点:源码包 需要放在 ` /usr/src/php/ext 下默认情况下,PHP容器没有 /usr/src/php这个目录,需要使用 docker-php-source extract来生成。docker-php-ext-install 安装的扩展在安装完成后,会自动调用docker-php-ext-enable来启动安装的扩展。卸载扩展,直接删除/usr/local/etc/php/conf.d 对应的配置文件即可。案例# 卸载redis 扩展 root@richerdyoung.com:/usr/local# rm -rf /usr/local/etc/php/conf.d/docker-php-ext-redis.ini root@richerdyoung.com:/usr/local# php -m [PHP Modules] Core ctype curl date dom fileinfo filter ftp hash iconv json libxml mbstring mysqlnd openssl pcre PDO pdo_sqlite Phar posix readline Reflection session SimpleXML sodium SPL sqlite3 standard tokenizer xml xmlreader xmlwriter zlib [Zend Modules] root@richerdyoung.com:/usr/local# #PHP容器默认是没有redis扩展的。所以我们通过docker-php-ext-install安装redis扩展 root@richerdyoung.com:/# curl -L -o /tmp/reids.tar.gz https://codeload.github.com/phpredis/phpredis/tar.gz/5.0.2 root@richerdyoung.com:/# cd /tmp root@richerdyoung.com:/tmp# tar -xzf reids.tar.gz root@richerdyoung.com:/tmp# ls phpredis-5.0.2 reids.tar.gz root@richerdyoung.com:/tmp# docker-php-source extract root@richerdyoung.com:/tmp# mv phpredis-5.0.2 /usr/src/php/ext/phpredis #检查移过去的插件源码包是否存在 root@richerdyoung.com:/tmp# ls -l /usr/src/php/ext | grep redis drwxrwxr-x 6 root root 4096 Jul 29 15:04 phpredis root@richerdyoung.com:/tmp# docker-php-ext-install phpredis # 检查redis 扩展是否已经安装上 root@richerdyoung.com:/tmp# php -m | grep redis redis root@richerdyoung.com:/tmp#docker-php-ext-configuredocker-php-ext-configure 一般都是需要跟 docker-php-ext-install搭配使用的。它的作用就是,当你安装扩展的时候,需要自定义配置时,就可以使用它来帮你做到。案例FROM php:7.1-fpm RUN apt-get update \ # 相关依赖必须手动安装 && apt-get install -y \ libfreetype6-dev \ libjpeg62-turbo-dev \ libmcrypt-dev \ libpng-dev \ # 安装扩展 && docker-php-ext-install -j$(nproc) iconv mcrypt \ # 如果安装的扩展需要自定义配置时 && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ && docker-php-ext-install -j$(nproc) gd
2021年10月22日
81 阅读
0 评论
0 点赞
2021-10-20
nginx解决跨域问题
nginx options 跨域问题 请求HTTP错误405 用于访问该页的HTTP动作未被许可 Method Not Allowed
2021年10月20日
192 阅读
0 评论
2 点赞
2021-10-18
Golang 语言极简 HTTP 客户端 GoRequest
1 介绍GoRequest 是一个极简的 HTTP 客户端,作者灵感来源于 Node.js 库 SuperAgent。相比 Golang 标准库 net/http,GoRequest 使用起来更加简单。GoRequest 官方的口号是 “像机枪一样发送请求”。GoRequest 包含以下功能:支持 HTTP 请求方式:Get/Post/Put/Head/Delete/Patch/Options支持设置 header 请求头支持使用 JSON 字符串作为请求参数支持将多路请求的方式发送数据和文件支持通过代理发送请求支持为请求设置超时支持 TLS 客户端设置支持设置重定向策略支持为请求设置 cookieCookieJar - automatic in-memory cookiejar支持请求头设置基本身份认证安装方式:go get github.com/parnurzeal/gorequest2 HTTP请求方式Golang 发送一个简单的 Get 请求,使用 net/http 标准库和使用 GoRequst 库,两种发送 Get 请求的方式都比较简单。示例代码如下:标准库方式:resp, err := http.Get("http://example.com/")GoRequest 库方式:request := gorequest.New() resp, body, errs := request.Get("http://example.com/").End()或(该 GoRequest 方式无法复用对象)resp, body, errs := gorequest.New().Get("http://example.com/").End()阅读上面这两段代码,我们可以发现,使用标准库的方式发送 Get 请求,甚至比使用 GoRequest 库的方式发送 Get 请求更加简单。但是,当我们需求稍作修改,比如我们需要为 Get 请求,设置 header 头和设置重定向策略。我们再来看一下分别使用标准库和 GoRequest 库两种实现方式。标准库方式:client := &http.Client{ CheckRedirect: redirectPolicyFunc, } req, err := http.NewRequest("GET", "http://example.com", nil) req.Header.Add("If-None-Match", `W/"wyzzy"`) resp, err := client.Do(req)GoRequest 库方式(其它 HTTP 请求方式与 Get 使用方式相同):request := gorequest.New() resp, body, errs := request.Get("http://example.com"). RedirectPolicy(redirectPolicyFunc). Set("If-None-Match", `W/"wyzzy"`). End()阅读上面两段代码,很容易发现使用 GoRequest 方式使实现更加简单。使用标准库方式,首先需要创建一个 Client,然后使用不同的命令设置 header 头等操作,这仅仅是为了实现一个 HTTP 请求。而使用 GoRequest 方式,仅需链式调用两个方法即可轻松实现。3 JSON 格式请求参数在 Golang 语言中,如果使用标准库 net/http 发送请求参数为 JSON 格式的 POST 请求,首先需要先将 map 或 struct 类型的数据,使用标准库 encoding/json 的 Marshal 方法,将数据转换为 JSON 格式的数据,并且设置 header 头参数 Content-Type 的值为 application/json,然后创建一个 Client,最终你的代码变得越来越长,越来越难维护。标准库方式:m := map[string]interface{}{ "name": "backy", "species": "dog", } mJson, _ := json.Marshal(m) contentReader := bytes.NewReader(mJson) req, _ := http.NewRequest("POST", "http://example.com", contentReader) req.Header.Set("Content-Type", "application/json") req.Header.Set("Notes","GoRequest is coming!") client := &http.Client{} resp, _ := client.Do(req)如果使用 GoRequest 库发送请求参数为 JSON 格式的 POST 请求,因为它默认支持 JSON 格式的请求参数,所以它只需要一行代码就可以实现。GoRequest 库方式:request := gorequest.New() resp, body, errs := request.Post("http://example.com"). Set("Notes","gorequst is coming!"). Send(`{"name":"backy", "species":"dog"}`). End()4支持回调函数 CallbackGoRequest 库还支持回调函数,你可以根据自己的项目需求灵活使用它,回调函数示例代码如下:func printStatus(resp gorequest.Response, body string, errs []error){ fmt.Println(resp.Status) } gorequest.New().Get("http://example.com").End(printStatus)5 请求控制在 Golang 项目开发中,有时我们可能需要对请求做一些额外控制,比如超时处理,重试请求 N 次,重定向处理等。GoRequest 库都可以为我们提供简单的实现方式。超时处理:request := gorequest.New().Timeout(2*time.Millisecond) resp, body, errs:= request.Get("http://example.com").End()需要注意的是,Timeout 是将 Dial 连接和 IO 读写的耗时总和,与时间参数作比较。重试请求:request := gorequest.New() resp, body, errs := request.Get("http://example.com/"). Retry(3, 5 * time.Second, http.StatusBadRequest, http.StatusInternalServerError). End()阅读上面这段代码,它的含义是当服务器返回结果是 http.StatusBadRequest 或 http.StatusInternalServerError 时,会每隔 5 秒重试请求一次,共重试 3 次。重定向处理:request := gorequest.New() resp, body, errs := request.Get("http://example.com/"). RedirectPolicy(func(req Request, via []*Request) error { if req.URL.Scheme != "https" { return http.ErrUseLastResponse } }). End() 阅读上面这段代码,它的含义是将 http 请求重定向为 https 请求。6 返回结果处理方式朋友们可能已经发现,以上示例代码都是以 End 结束,End 的含义是返回结果是字符串类型,如果我们希望返回结果是其他类型,比如字节类型和结构体类型,可以将 End 分别替换为 EndBytes 和 EndStruct。EndBytes 格式:resp, bodyBytes, errs := gorequest.New().Get("http://example.com/").EndBytes()EndStruct 格式:heyYou struct { Hey string `json:"hey"` } var heyYou heyYou resp, _, errs := gorequest.New().Get("http://example.com/").EndStruct(&heyYou)7 总结本文我们介绍 Golang 语言的极简 HTTP 客户端 GoRequest 以及它的使用方法。它比标准库 net/http 使用方式简单,当我们项目开发中需要使用 HTTP 方式调用接口时,强烈推荐使用 GoRequest 库。GoRequest 底层在大多数用例中是基于 http.Client 实现的,所以通过一次调用 gorequest.New() 得到的对象,应尽可能多次使用。GoRequest 除了上面介绍的 JSON 参数,它还支持 Struct 和 File,感兴趣的读者可以查阅官方文档了解相关内容。https://github.com/parnurzeal/gorequest
2021年10月18日
261 阅读
0 评论
1 点赞
2021-10-09
nginx-rewrite规则
作用场景:URL访问跳转,支持开发设计,如页面跳转,兼容性支持,展示效果等SEO优化维护:后台维护、流量转发等安全调整用户浏览的URL,看起来规范为了让搜索引擎收录网站内容,让用户体验更好网站更换新域名后根据特殊的变量、目录、客户端信息进行跳转注:nginx官方文档:http://nginx.org/en/docs/http/ngx_http_rewrite_module.html1、rewrite语法:指令语法:rewrite regex replacement[flag];默认值:none应用位置:server、location、ifrewrite是实现URL重定向的重要指令,他根据regex(正则表达式)来匹配内容跳转到replacement,结尾是flag标记简单的小例子:# 匹配成功后跳转到百度,执行永久301跳转 rewrite ^/(.*) http://www.baidu.com/ permanent;常用正则表达式:字符描述\将后面接着的字符标记为一个特殊字符或者一个原义字符或一个向后引用^匹配输入字符串的起始位置$匹配输入字符串的结束位置*匹配前面的字符零次或者多次+匹配前面字符串一次或者多次?匹配前面字符串的零次或者一次.匹配除“\n”之外的所有单个字符(pattern)匹配括号内的patternrewrite 最后一项flag参数:标记符号说明last停止rewrite检测【如果没有匹配到,会继续向下匹配】break停止rewrite检测【如果没有匹配到,则不再向下匹配,直接返回结果404redirect返回302临时重定向,地址栏会显示跳转后的地址permanent返回301永久重定向,地址栏会显示跳转后的地址
2021年10月09日
130 阅读
0 评论
4 点赞
2021-09-30
Golang之log(如何将日志写到指定文件里面)
对于Go语言的日志来说,如何将log写到指定的文件里面,下面是一个例子。如何将log 写入到指定的文件中?方法一:package main import ( "log" "os" "time" ) func init() { file := "./" +"log"+ ".txt" logFile, err := os.OpenFile(file, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0766) if err != nil { panic(err) } log.SetOutput(logFile) // 将文件设置为log输出的文件 log.SetPrefix("[logTool]") log.SetFlags(log.LstdFlags | log.Lshortfile | log.LUTC) return } func main() { log.Println("Hello laofan!") // log 还是可以作为输出的前缀 return }output:// message.txt里面 显示 [logTool]2021/09/30 15:30:05 log.go:24: Hello laofan! 方法二:package main import ( "log" "os" "time" ) var loger *log.Logger func init() { file := "./" + time.Now().Format("20210930") + ".txt" logFile, err := os.OpenFile(file, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0766) if err != nil { panic(err) } loger = log.New(logFile, "[logTool]",log.LstdFlags | log.Lshortfile | log.LUTC) // 将文件设置为loger作为输出 return } func main() { // 使用的时候,需要采用loger作为输出的前缀 loger.Println("Hello:laofan!") return } output:// message.txt里面 显示 [logTool]2021/09/30 15:35:20 log.go:24: Hello laofan! `` 灰子作于二零二一年九月三十日。
2021年09月30日
827 阅读
0 评论
0 点赞
2021-09-21
tree命令输出目录树层结构
你也想要生成这个目录树层结构吗?,按下面操作即可:. ├── etc │ └── greet-api.yaml ├── go.mod ├── go.sum ├── greet.api ├── greet.go └── internal ├── config │ └── config.go ├── handler │ ├── greethandler.go │ └── routes.go ├── logic │ └── greetlogic.go ├── svc │ └── servicecontext.go └── types └── types.go 7 directories, 11 files 1 、安装 tree# mac 下使用 brew包管理工具 brew install tree # linux 下使用yum安装 yum install tree2、 安装成功后,直接在终端使用,使用 --help 查看帮助信息tree --help看到如下功能usage: tree [-acdfghilnpqrstuvxACDFJQNSUX] [-H baseHREF] [-T title ] [-L level [-R]] [-P pattern] [-I pattern] [-o filename] [--version] [--help] [--inodes] [--device] [--noreport] [--nolinks] [--dirsfirst] [--charset charset] [--filelimit[=]#] [--si] [--timefmt[=]<f>] [--sort[=]<name>] [--matchdirs] [--ignore-case] [--] [<directory list>] ------- Listing options ------- -a All files are listed. -d List directories only. -l Follow symbolic links like directories. -f Print the full path prefix for each file. -x Stay on current filesystem only. -L level Descend only level directories deep. -R Rerun tree when max dir level reached. -P pattern List only those files that match the pattern given. -I pattern Do not list files that match the given pattern. --ignore-case Ignore case when pattern matching. --matchdirs Include directory names in -P pattern matching. --noreport Turn off file/directory count at end of tree listing. --charset X Use charset X for terminal/HTML and indentation line output. --filelimit # Do not descend dirs with more than # files in them. --timefmt <f> Print and format time according to the format <f>. -o filename Output to file instead of stdout. -------- File options --------- -q Print non-printable characters as '?'. -N Print non-printable characters as is. -Q Quote filenames with double quotes. -p Print the protections for each file. -u Displays file owner or UID number. -g Displays file group owner or GID number. -s Print the size in bytes of each file. -h Print the size in a more human readable way. --si Like -h, but use in SI units (powers of 1000). -D Print the date of last modification or (-c) status change. -F Appends '/', '=', '*', '@', '|' or '>' as per ls -F. --inodes Print inode number of each file. --device Print device ID number to which each file belongs. ------- Sorting options ------- -v Sort files alphanumerically by version. -t Sort files by last modification time. -c Sort files by last status change time. -U Leave files unsorted. -r Reverse the order of the sort. --dirsfirst List directories before files (-U disables). --sort X Select sort: name,version,size,mtime,ctime. ------- Graphics options ------ -i Don't print indentation lines. -A Print ANSI lines graphic indentation lines. -S Print with CP437 (console) graphics indentation lines. -n Turn colorization off always (-C overrides). -C Turn colorization on always. ------- XML/HTML/JSON options ------- -X Prints out an XML representation of the tree. -J Prints out an JSON representation of the tree. -H baseHREF Prints out HTML format with baseHREF as top directory. -T string Replace the default HTML title and H1 header with string. --nolinks Turn off hyperlinks in HTML output. ---- Miscellaneous options ---- --version Print version and exit. --help Print usage and this help message and exit. -- Options processing terminator. 3、 输出你的树层目录结构cd 目标文件夹路径然后 tree 一下,会将该层级下所有文件都遍历了输出,不管层级多深4、 常用技巧我们可以在目录遍历时使用 -L 参数指定遍历层级tree -L 2如果你想把一个目录的结构树导出到文件 Readme.md ,可以这样操作tree -L 2 >README.md //然后我们看下当前目录下的 README.md 文件只显示文件夹tree -d 显示项目的层级,n表示层级数。例:显示项目三层结构,tree -l 3;tree -L n tree -I pattern 用于过滤不想要显示的文件或者文件夹。比如要过滤项目中的node_modules文件夹;tree -I “node_modules”
2021年09月21日
124 阅读
0 评论
2 点赞
2021-09-18
markdown折叠内容语法
如题,语法是:<details> <summary>Title</summary> content!!! </details> 举例 <details> <summary>CLICK ME</summary> **<summary>标签与正文间一定要空一行!!!** </details>
2021年09月18日
160 阅读
0 评论
0 点赞
2021-09-14
清除谷歌浏览器的dns缓存
清除谷歌浏览器的dns缓存
2021年09月14日
160 阅读
0 评论
2 点赞
2021-09-13
mac下为MAMP添加php扩展msgpack
查看最新的扩展版本https://pecl.php.net/package/msgpackPHP7.2.22 的文件夹地址/Applications/MAMP/bin/php/php7.2.22wget -c https://pecl.php.net/get/msgpack-0.0.1.tgz tar zxvf msgpack.tgz cd msgpack /Applications/MAMP/bin/php/php7.2.22/bin/phpize ./configure --with-php-config=/Applications/MAMP/bin/php/php7.2.22/bin/php-config make && make install vi /Applications/MAMP/bin/php/php7.2.22/etc/php.ini #加上一行 extension=msgpack.so # 重启下php # php -m 验证
2021年09月13日
132 阅读
0 评论
2 点赞
1
...
6
7
8
...
15