Skip to content

Instantly share code, notes, and snippets.

View emisjerry's full-sized avatar

emisjerry emisjerry

View GitHub Profile
@emisjerry
emisjerry / obsidian.ahk
Created July 4, 2020 11:31
AutoHotkey Scripts for obsidian.md
;; Scripts for obsidian.md
;; http://jdev.tw/blog
;; v0.1 2020/07/02 jerry
#SingleInstance Force
:O*:d0::
;; 0409 language code for USA
FormatTime, vToday,L0x0409, yyyy-MM-dd_ddd
send [[%vToday%]]
return
@emisjerry
emisjerry / my_init.lua
Created November 28, 2025 03:45
Lua scripts for function keys F1~F9, simulating cmd.exe's similar behavior.
-- When you press F2, the command prompt asks you to type a character.
-- It then copies the previous command up to (but not including) that character.
nyagos.key.f2 = function(this)
local _sCmdLine = this.text;
if (this.pos > 1) then
this:call("BEGINNING_OF_LINE")
end
nyagos.write("\nEnter char to copy up to: ")
local _sKey=nyagos.getkeys()
nyagos.write("\r\027[K\027[A")
@emisjerry
emisjerry / obsidian-callout.lua
Created January 9, 2025 02:05
obsidian-callout.lua filter for Pandoc to convert Obsidian callout into pandoc fenced divs
local stringify = (require "pandoc.utils").stringify
function BlockQuote (el)
start = el.content[1]
if (start.t == "Para" and start.content[1].t == "Str" and
start.content[1].text:match("^%[!%w+%][-+]?$")) then
_, _, ctype = start.content[1].text:find("%[!(%w+)%]")
el.content:remove(1)
start.content:remove(1)
div = pandoc.Div(el.content, {class = "callout"})
@emisjerry
emisjerry / !WS網路服務.md
Last active November 12, 2025 03:11
[常用的網站 !WS網路服務] Obsidian note for frequently used web sites. #obsidian #筆記
obsidianUIMode created modified tags aliases
source
2021-10-18 00:17:00 -0700
2021-11-07 20:45:41
網路服務模板
Web Service

%%

@emisjerry
emisjerry / templater-quickadd-daily.txt
Last active August 17, 2025 05:14
Obsidian QuickAdd Templater Daily Note (副檔名應為.md)
---
created: <% tp.date.now("YYYY-MM-DD HH:mm") %>
modified:
aliases: [<% tp.file.title %>]
mood: {{VALUE:😃,😡,😭,😁}}
weather: "<% tp.user.天氣_台北市() %>"
tags: [ daily ]
---
# <% tp.file.title %>
@emisjerry
emisjerry / select_tags.js
Created October 22, 2021 14:57
Obsidian QuickAdd macro for selecting YAML tags
module.exports = async function select_tags(params) {
const {app, quickAddApi: {suggester}} = params;
const allTags = Object.keys(app.metadataCache.getTags());
let tag = await suggester(allTags, allTags);
if (!tag) return;
tag = tag.substring(1); // skip the hash symbol
return tag;
}
@emisjerry
emisjerry / test9.ahk
Created September 29, 2019 07:14
使用AutoHotkey快速切換語言鍵盤,和超難用的Ctrl/Alt+Shift說再見!(AHK #9)
#SingleInstance Force
!1::
SetDefaultKeyboard(0x0409) ;; 切換為英文輸入
return
!2::
SetDefaultKeyboard(0x0404) ;; 切換為中文輸入
return
@emisjerry
emisjerry / capture-format-test
Created September 12, 2021 02:46
Capture-format: test using QuickAdd inline javascript
```js quickadd
selection = window.getSelection();
selText = selection.toString()
console.log("selection", selText);
const activeFile = this.app.workspace.getActiveFile();
if (!activeFile) {
new Notice("No active file", 5000);
return;
}
console.log("active file=", activeFile);
@emisjerry
emisjerry / anki1.ahk
Last active April 28, 2025 13:28
Using AutoHotkey post flashcard information to Anki
#SingleInstance Force
f1::
url := "http://localhost:8765"
httpClient := ComObjCreate("WinHttp.WinHttpRequest.5.1")
httpClient.Open("POST", url, false)
;httpClient.SetRequestHeader("User-Agent", User-Agent)
;httpClient.SetRequestHeader("Content-Type", Content-Type)
;httpClient.SetRequestHeader("Cookie", Cookie)
@emisjerry
emisjerry / Markdown Tutorial.md
Created May 2, 2022 11:45
Markdown Tutorial. (Obsidian)

aliases: Markdown Tutorial, Obs 82 obsidianUIMode: source tags: 專案筆記, obsidian, markdown AutoNoteMover: disable disabled rules: [] created: "2022-04-04 14:53:25" modified: "2022-05-02 19:43:33" cssClasses: table-lines, row-alt blog: http://jdev.tw/blog/7066/