Skip to content

Instantly share code, notes, and snippets.

View Moyf's full-sized avatar

Moy Moyf

  • HangZhou
View GitHub Profile
# default.custom.yaml
# save it to:
# ~/.config/ibus/rime (linux)
# ~/Library/Rime (macos)
# %APPDATA%\Rime (windows)
patch:
schema_list:
- schema: luna_pinyin # 朙月拼音
- schema: luna_pinyin_simp # 朙月拼音 简化字模式
@Moyf
Moyf / Snippet.lua
Created May 14, 2018 11:13
测试用的 Lua Snippet
function test(){
print "test"
}
@Moyf
Moyf / DataviewJS.md
Last active April 24, 2025 16:29
[Obsidian] Dataviewjs code for Obsidian to query specific term in current note

最简版本:

```dataviewjs
await dv.view("queryTermInFile", { term: "💡" })
```

最多选项版本: [term::💡] [info::灵感摘录]

@Moyf
Moyf / MakeItDone
Last active December 26, 2024 05:41
TP Script: Add done and finished date into Frontmatter (Property)
<%*
/*
- Author: Moy
- Create Time: 2024-07-30
- Description: 这是一个用来修改当前文件的元数据的范例脚本
- Version: 1.0
*/
// 配置项
@Moyf
Moyf / Moy-Link Optimize.css
Created July 31, 2024 16:12
Obsidian CSS: Optimize the link editing experience
@Moyf
Moyf / LiteDatabase-en.js
Last active January 17, 2025 06:55
DVJS Code - Lite Database for Obsidian
const useList = false;
const curNote = dv.current();
if (!curNote){
dv.span("The current document is not loaded, please reopen it.");
return;
}
let tarFile = await app.vault.getAbstractFileByPath(curNote.file.path);
// Get the meta data of the current file
const curFileMeta = app.metadataCache.getFileCache(tarFile);
const headings = curFileMeta.headings;
// ========================================
// 作者:Moy
// 日期:2024.08.05
// 版本:1.0.0
// ========================================
// 注意:该脚本只在文件名为 yyyy-MM-dd 日期格式(如 2024-08-05)的笔记内有效
// 如果你的 DailyNote 有别的命名格式,自行下方的 yyyy-MM-dd
const curNoteName = dv.current().file.name;
const dateFormat = "yyyy-MM-dd"
@Moyf
Moyf / Moy-Grid Background.css
Last active May 5, 2025 19:55
Obsidian Grid Background (网格背景)
/* Moy-网格背景 */
/* 更新日期:2024.10.31 */
/* 用来显示两种样式的背景:网格 & 网点 */
/* 2024.10.30 v1.1 改成默认所有页面都生效(网格) */
/* 2024.11.01 v1.2 只影响中间窗格 */
/* 原始代码来自:https://spacexcode.com/blog/pure-css-grid-line/ */
/* 亦有参考:https://forum-zh.obsidian.md/t/topic/37076 */
@Moyf
Moyf / 0_Introduction.md
Last active April 4, 2025 18:34
[NTB×TP] Share some useful scripts that I use with NTB 😇

(1) ReOrder Tasks

This action will reorder the tasks near the cursor (or select Chinese version) based on the current cursor position, and put the completed tasks at the bottom.

(2) Cancel Task

This is a utility function done by the

@Moyf
Moyf / FolderSearch 文件夹搜索.md
Last active March 17, 2025 11:40
TP脚本:搜索文件夹 FolderSearch (English version is below)

<%* // 获取所有文件夹路径 let folders = app.vault.getAllFolders(); // 过滤掉根目录 folders = folders.filter(folder => folder.path !== "/");

const autoCollapse = true;

// 准备用于显示的文件夹名称和对应的路径 const folderPaths = folders.map(f => f.path);