Skip to content

Instantly share code, notes, and snippets.

@xbol0
xbol0 / claude_3.5_sonnet_artifacts.xml
Created June 25, 2024 09:57 — forked from dedlim/claude_3.5_sonnet_artifacts.xml
Claude 3.5 Sonnet, Full Artifacts System Prompt
<artifacts_info>
The assistant can create and reference artifacts during conversations. Artifacts are for substantial, self-contained content that users might modify or reuse, displayed in a separate UI window for clarity.
# Good artifacts are...
- Substantial content (>15 lines)
- Content that the user is likely to modify, iterate on, or take ownership of
- Self-contained, complex content that can be understood on its own, without context from the conversation
- Content intended for eventual use outside the conversation (e.g., reports, emails, presentations)
- Content likely to be referenced or reused multiple times
@xbol0
xbol0 / lexical_search_with_gzip.py
Created September 26, 2023 08:31 — forked from kyo-takano/lexical_search_with_gzip.py
Lexical Search with gzip (gzipによる語彙検索)
import gzip
def gzip_search(query: str, candidate_chunks: list[str], top_k: int=1):
"""
文字列ベースで類似したテキストチャンクを推定するアルゴリズム.
`query`, `chunk`, および`query + " " + chunk`をそれぞれgzipで圧縮し編集距離のようなものをベースに評価する.
Parameters:
query (str): 検索クエリとして使用する文字列.
top_k (int, optional): 返される類似チャンクの上位k個を指定する (default: 1).
@xbol0
xbol0 / .Cloud.md
Created December 6, 2022 10:48 — forked from imba-tjd/.Cloud.md
☁️ 一些免费的云资源

IaaS指提供系统(可以自己选)或者储存空间之类的硬件,软件要自己手动装;PaaS提供语言环境和框架(可以自己选);SaaS只能使用开发好的软件(卖软件本身);BaaS一般类似于非关系数据库,但各家不通用,有时还有一些其它东西。

其他人的集合

@xbol0
xbol0 / powtcha.ts
Created November 15, 2022 02:43
pow captcha
async function pow(source: string, diff: number, signal?: AbortSignal) {
let i = 0n;
while (!signal?.aborted) {
const res = new TextEncoder().encode(source + "." + i.toString(16));
const h = await crypto.subtle.digest("SHA-512", res);
if (checkResult(new Uint8Array(h), diff)) {
return i;
}
i++;
}
0. 密码管理(可选)
推荐app:lesspass,所有平台所有区都有app,还有网页版和命令行版
离线生成强密码,不依赖任何托管服务,只需要记住一个主密码
网页版:https://www.lesspass.com/
手机app可以不给网络访问权限,不登录,只用faceid自动填充主密码
使用方法:
1. 设置自己的主密码,因为主密码参与计算,参数一样生成的密码就是一样的
@xbol0
xbol0 / helix-config.toml
Last active October 3, 2022 06:25
helix config
theme = "dracula"
[editor.statusline]
left = ["mode", "selections", "file-encoding", "diagnostics"]
center = ["file-name"]
right = ["position", "position-percentage", "spinner"]
[keys.normal]
C-s = ":w"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@xbol0
xbol0 / vimrc
Last active July 20, 2022 06:33
vimrc
" 自用vim配置
" 特性说明
"
" 适配iterm2指针
" 空格作为leader键
" c-jkhl移动分屏
" c-q替换esc键,方便在ipad上用
set background=dark
colorscheme default