在 macOS 上实现定时任务的推荐方式之一是使用系统自带的 launchd 守护进程。你可以通过配置 plist
文件并使用 launchctl
命令进行任务的加载、卸载和管理。本文将详细介绍使用 launchd
的方法,包含定时执行、系统重启后仍能生效、日志输出等完整配置。
macOS 定时任务(自动化任务)
什么是 AWS Lambda Layer(层)
AWS Lambda 层(Layer) 是包含库、自定义运行时或其他依赖项的 ZIP 存档文件。通过层,可以在函数中使用库、其它依赖的数据文件,而无需将它们包含在项目代码的部署包中。
macOS 借助 Alfred 快速创建文本文件
macOS 的访达并不支持创建新文件。如何快速创建一个文本文件,并且最好还能直接把剪贴板中的文件保存到其中。
Alfred 5 的 Universal Actions 可以通过快捷键在访达中直接触发 Workflow。并且传递当前的路径给到 Workflow.
Obsidian 手动设定图片显示尺寸大小
从 pypi 下载软件包(非安装)文件
以 httpx 软件包为例:
pip download httpx
macOS 命令行查看文件夹内容结构
macOS 命令行终端里如何显示当前目录结构,查看当前目录及其子目录中的所有文件和文件夹,并以树状结构展示出来。
可以使用自带的 ls
命令。安装和使用 tree
命令效果更好。
Python 从源码路径安装依赖包
例如多个项目用到自己写的一个存储在本地的依赖包。这个包会持续的修正更新。
这样做的好处是当修改这个包的代码时,引用此包的项目也将立即使用修改后的代码。
与 ChatGPT 对话的艺术与技巧
参考 让 ChatGPT 成为你的得力助手 这边文章发现更多用法。
在使用过程中如何更好的引导 ChatGPT,有一些经验技巧分享如下。
🤔️ 有时候 ChatGPT 的回答内容别截断了,如何显示剩余内容
可以向它说:继续
Arweave 智能合约代码的规范
先是引用。然后是翻译。
以下英文引用自 warp docs
Contract source code specification
- A contract source code MAY be written in ES module format.
- A contract source MUST contain function (sync or async) named
handle
. - A contract source MAY use IIFE bundling format.
- The
handle
function MUST accept exactly two arguments:state
andaction
- The
state
argument MUST be the current state of the contract. - The
action
argument MUST containcaller
field (i.e. Arweave wallet address) andinput
field. Theinput
field MUST contain thefunction
field and any additional data required to perform given operation. - The maximum size of the JSON.stringified representation of the
input
field MUST NOT exceed 2048 bytes. - The
handle
function MUST terminate by either:- returning
{ state: newState }
- this will cause the contract state to be updated - returning
{ result: newResult }
- throwing
ContractError
- returning
以下是我的翻译: