Skip to content

Instantly share code, notes, and snippets.

@hanxiao
hanxiao / testRegex.js
Last active April 14, 2025 03:31
Regex for chunking by using all semantic cues
// Updated: Aug. 20, 2024
// Run: node testRegex.js whatever.txt
// Live demo: https://jina.ai/tokenizer
// LICENSE: Apache-2.0 (https://www.apache.org/licenses/LICENSE-2.0)
// COPYRIGHT: Jina AI
const fs = require('fs');
const util = require('util');
// Define variables for magic numbers
const MAX_HEADING_LENGTH = 7;
@lewangdev
lewangdev / default.custom.yaml
Last active April 14, 2025 15:12
雾凇拼音自定义配置,MacOS-like & Wechat-like Dark/Light Color Scheme For Rime
patch:
# 菜单
menu:
page_size: 8 # 候选词个数
# alternative_select_labels: [ ①, ②, ③, ④, ⑤, ⑥, ⑦, ⑧, ⑨, ⑩ ] # 修改候选项标签
# alternative_select_keys: ASDFGHJKL # 如编码字符占用数字键,则需另设选字键
# ascii_mode、inline、no_inline、vim_mode 等等设定,可参考 /Library/Input Methods/Squirrel.app/Contents/SharedSupport/squirrel.yaml
# 中西文切换
#
# 【good_old_caps_lock】 CapsLock 切换到大写或切换中英。
@Xuanwo
Xuanwo / Highlight
Last active February 1, 2023 07:22
Readwise Logseq Output
> {{ highlight_text }}
date:: [[{{highlight_date}}]] \
{% if highlight_location_url %}location:: {{highlight_location_url}}{% elif highlight_location %}location:: {{highlight_location}}{% endif %} \
{% if highlight_note %}
{{ highlight_note }}
{% endif %}
---
@zengjie
zengjie / dedao-flomo-notion-readwise.py
Last active August 21, 2024 01:47
把 Flomo 同步到 Notion 的得到电子书笔记,导出到 ReadWise
import csv
from notion_client import Client
from notion_client.helpers import iterate_paginated_api
# Flomo 在 Notion 中的同步数据库需要增加两个字段:
# - 得到电子书:formula 字段,公式为 `contains(prop("Tags"), "得到/电子书")`
# - 书名:formula 字段,公式为 `replaceAll(prop("Tags"), "得到/电子书/", "")`
@tiensonqin
tiensonqin / logseq-queries.md
Created December 5, 2022 04:44
Initial input for chatgpt
  • What are "Queries" in Logseq?
    • Queries are for asking questions from your knowledge base and the outside world.
      • How to write simple queries?
        • By using {{query }}, the format is something like this:
        {{query Something you're looking for}}
        
  • **Query Operators ** These three operators can be applied around any query filters.
    • and
@psu
psu / logseq-config-default-queries.edn
Last active April 12, 2025 17:25
logseq-config-default-queries.edn
;; Logseq Default Query 6-pack
;; ---------------------------
;;
;; Pontus Sundén (@psu)
;; October 28, 2022
;;
;; Attribution
;; - https://gist.github.com/sawhney17/3a1b04936f35df80253431a61cb74737
;;
;; ---------------------------
@knoopx
knoopx / README.md
Last active July 16, 2023 07:12
logseq config: ui tweaks, minimalist and colorful

Turns

image

into

image

@sethyuan
sethyuan / custom.js
Last active August 6, 2022 12:54
Logseq namespace collapsing
function collapseNamespaceRefs() {
function onEnter(e) {
const el = e.target;
el.textContent = el.dataset.origText;
}
function onLeave(e) {
const el = e.target;
const text = el.dataset.origText;
el.textContent = `..${text.substring(text.lastIndexOf("/") + 1)}`;
@kevinjalbert
kevinjalbert / import-raindrop-highlights-into-readwise.rb
Last active February 28, 2025 22:51
Import Raindrop.io Highlights into Readwise
#!/usr/bin/env ruby
require "httparty"
require "nokogiri"
require "open-uri"
require "uri"
RAINDROP_AUTH_TOKEN="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
READWISE_AUTH_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
LAST_SAVED_HIGHLIGHT=000000000 # <- Keeps track of import position (Updates automatically)
@mkyt
mkyt / fix-pages-metadata-conflicts.py
Last active December 6, 2022 15:36
Fix merge conflicts for `pages-metadata.edn` of LogSeq data directory
#!/usr/bin/env python3
from pathlib import Path
from typing import Union, Tuple, List, NamedTuple, Dict
import sys
class Block(NamedTuple):
name: str
created: int
updated: int