(cl-defstruct (org-roam-node (:constructor org-roam-node-create)
(:constructor org-roam-node-create-from-db
(title
id file file-title level todo
pos priority scheduled deadline
properties olp atime mtime tags
aliases refs))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(cl-defstruct (org-roam-node (:constructor org-roam-node-create) | |
(:constructor org-roam-node-create-from-db | |
(title aliases ; 2 | |
id file file-title level todo ; 5 | |
point priority scheduled deadline properties ;;5 | |
olp file-atime file-mtime tags refs)) ;;5 | |
(:copier nil)) | |
"A heading or top level file with an assigned ID property." | |
file file-title file-hash file-atime file-mtime ;5 | |
id level point todo priority ; 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun dmg-test-function () | |
(org-roam-db-query | |
"SELECT | |
id, | |
file, | |
filetitle, | |
\"level\", | |
todo, | |
pos, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
time sqlite3 /tmp/org-roam.db | wc <<EOF | |
SELECT | |
id, | |
file, | |
filetitle, | |
"level", | |
todo, | |
pos, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun org-roam-node-list () | |
(let ((rows (org-roam-db-query | |
"SELECT | |
id, | |
file, | |
filetitle, | |
\"level\", | |
todo, | |
pos, | |
priority , |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(setq dmg-roam-candidates-cache (make-hash-table :test 'equal)) | |
(defun org-roam-node-read--to-candidate (node template) | |
"Return a minibuffer completion candidate given NODE. | |
TEMPLATE is the processed template used to format the entry." | |
(let* ((args (list node template)) | |
(cached-result (gethash args dmg-roam-candidates-cache)) | |
) | |
(if cached-result |
(let ((startTime (float-time)))
(progn
; (print (length (org-roam-node-read--completions)))
(print (length (org-roam-node-list)))
(print (- (float-time) startTime)))))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function is_front_by_bundle_id(bundleID) | |
local currentWindow = hs.window.focusedWindow() | |
local currentBundle = nil | |
if currentWindow then | |
currentBundle = currentWindow:application():bundleID() | |
end | |
return currentBundle == bundleID | |
end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
# replace the next line with the location of your addon | |
MDIR=/home/dmg/.local/share/Anki2/addons21/MecabUnidic/support | |
export LD_LIBRARY_PATH=$MDIR: | |
export DYLD_LIBRARY_PATH=$MDIR: | |
#$MDIR/mecab.lin --eos-format='\n' --unk-format='' -d $MDIR -r $MDIR/mecabrc "$1" | |
# MECAB_NODE_UNIDIC_22_PARTS = ['%f[7]', '%f[10]', '%m', '%f[6]', '%f[0]', '%f[1]'] | |
# i swapped the location of %m to first column | |
#$MDIR/mecab.lin -P | |
$MDIR/mecab.lin --eos-format='\t\t\t\tEOS\tEOS\n' --unk-format='%M\t%f[0]\t%M\t%f[1]\tunknown\tunknown\n' --node-format='%f[7]\t%f[10]\t%m\t%f[6]\t%f[0]\t%f[1]\n' -d $MDIR -r $MDIR/mecabrc "$1" |