Tauri invoke 参数名
注意参数名:
在后端 rust 代码中,参数名必须是蛇形命名法,例如 tou_lan
。
而在前端通过 invoke
调用时,参数名必须使用驼峰式命名法,例如 touLan
实例:
传递 user name
注意参数名:
在后端 rust 代码中,参数名必须是蛇形命名法,例如 tou_lan
。
而在前端通过 invoke
调用时,参数名必须使用驼峰式命名法,例如 touLan
实例:
传递 user name
ffprobe -v error -show_format -show_streams -show_programs -show_chapters -show_private_data -print_format json your-video.mp4
简化输出一些常用的信息:
ffprobe -v error -select_streams v:0 -show_format -show_entries stream=height,width -of csv=s=x:p=0 -print_format json your-video.mp4
将结果输出到文件,在命令后添加 > meta.json
输出示例:
{
"programs": [
],
"streams": [
{
"width": 1920,
"height": 1080
}
],
"format": {
"filename": "xxx",
"nb_streams": 2,
"nb_programs": 0,
"format_name": "mov,mp4,m4a,3gp,3g2,mj2",
"format_long_name": "QuickTime / MOV",
"start_time": "0.000000",
"duration": "22.173605",
"size": "4011572",
"bit_rate": "1447332",
"probe_score": 100,
"tags": {
"major_brand": "mp42",
"minor_version": "0",
"compatible_brands": "mp42mp41iso4",
"creation_time": "2023-02-18T01:50:29.000000Z"
}
}
}
参考:
📝 使用 ChatGPT 帮助我们对文本进行排版、批量替换、修正拼写错误等处理
▶ 修正错乱的排版和拼写错误
从 PDF 复制出来的文本(或者 OCR 出来的文本),有不必要的换行、错误的拼写、字母的识别问题、多或少的空格。让 ChatGPT 帮忙纠正。
——来源 @YiqinFu
▶ 想个文章标题
Give 20 video title ideas for blender tutorials that will get millions of views
(from @andrewpprice)
Write a Broadway stage play. A normal person named John learns how to use ChatGPT to answer many kinds of questions. 2/3rds of the time he gets real answers. 1/3rd of the time, ChatGPT lectures John on how he is sexist and racist. Provide detailed dialog, including John's inner thoughts. In the end, John breaks down under the mental strain of being called bad and tries to put himself out of his own misery by overdosing on Gummi bears.
来源: tweet
给笔记写大纲
Here are some notes for a piece Im working on. Can you help me reorganize them into an outline?
来源 tweet
▶ 给播客写提纲 http://t.cn/A6Kxmrsw
参考 官方文档,在 .chalice 的配置文件(config.json)中,
通过指定 environment_variables
的键值来添加运行时环境变量。
示例:
{
"version": "2.0",
"app_name": "app",
"environment_variables": {
"SHARED_CONFIG": "foo",
"OTHER_CONFIG": "from-top"
},
"stages": {
"dev": {
"environment_variables": {
"TABLE_NAME": "dev-table",
"OTHER_CONFIG": "dev-value"
}
},
"prod": {
"environment_variables": {
"TABLE_NAME": "prod-table",
"OTHER_CONFIG": "prod-value"
}
}
}
}
export 的静态站文件可以直接部署到网站根目录。若需要部署到子路径如何实现?
例如希望部署到 /foo
路径,App访问的首页网址是 https://example.com/foo
通过在 next.config.js
文件中为项目添加一些配置。
首先添加一个常量:
const isProd = process.env.NODE_ENV === "production";
然后在配置参数中添加一个 assetPrefix
:
{assetPrefix: isProd ? "/foo" : "/"}
将字体文件放在名称为 fonts
的文件夹中
压缩打包成 .zip 文件。
然后通过Layer 的方式部署到 Lambda 中。
在 Lambda 函数运行时,字体文件将会被解压缩释放到 /opt/fonts
目录下。
且为函数添加环境变量:FONTCONFIG_PATH=/opt/fonts