<%* const title = tp.file.title; const uri = 'obsidian://open?vault=Vault&file=' + encodeURI(title); const fullstring = '[' + title + ']' + '(' + uri + ')'; navigator.clipboard.writeText(fullstring); %>
#!/usr/bin/env zx | |
// yabai message | |
const ym = async (arg) => await $`yabai -m ${arg.split(" ")}`; | |
const hideAllApps = async () => { | |
await $`osascript -e 'tell application "System Events" to set visible of every process whose visible is true to false'`; | |
}; | |
const laptop = 1; |
<%* | |
const dv = app.plugins.plugins["dataview"].api; | |
const openPublishPanel = app.commands.commands["publish:view-changes"].callback; | |
// ---------------------- | |
// Update query files | |
// ---------------------- | |
const updateQueryFiles = async () => { | |
const fileAndQuery = new Map([ | |
[ | |
"Books Read (Auto-Updating)", |
/* Formatting for Bible verses (h6 headers) in Obsidian */ | |
.markdown-preview-view h6, | |
.cc-pretty-preview .markdown-preview-view h6 | |
{ | |
position: relative; | |
left: -4%; | |
top: 18px; | |
line-height: 0px; | |
margin-top: -20px; | |
margin-right: 3px; |
#!/bin/bash | |
# ------------------------------------------------- | |
# Before running the script, make sure that you understand it. Running code you find on the Internet may damage your system. | |
# ------------------------------------------------- | |
# In Amazing marvin, set the path to this script as "Start time tracking task" in the "System Triggers strategy" like this: | |
# /Path/to/this/script $TASK_TITLE | |
# Replace "YourSecretToken" with your Toggl API token below. | |
# ------------------------------------------------- | |
curl -v -u YourSecretToken:api_token \ |
// Author: Joschua // Original gist: https://gist.github.com/selfire1/bd1ebf8fd5af629f45a43cef99623236
// Set the amount of search results to fetch maxResults = 3 // Opens a dialogue for book to search for bookQuery = await tp.system.prompt("Enter book to search for 📚🔎");
// Calls the Google Book API to fetch book data
on run argv | |
-- Variables | |
set _cmd to (item 1 of argv) | |
tell application "Finder" to set _bounds to bounds of window of desktop | |
set _xPos to (item 1 of _bounds) | |
set _yPos to (item 2 of _bounds) | |
set _ySize to (item 3 of _bounds) | |
set _xSize to (item 4 of _bounds) | |
-- get bounds | |
-- do split: app1, app2, set split |
<%* // Select active line // Source: https://gist.github.com/GitMurf/c52dfef13162d88375975e4eefedf3a7 const editor = app.workspace.activeLeaf.view.editor; const curLineNum = editor.getCursor().line; editor.setSelection({ line: curLineNum, ch: 0 }, { line: curLineNum, ch: editor.getLine(curLineNum).length }); let copiedStr = editor.getSelection(); copiedStr = copiedStr.trim();
// Replace formatting
<%*
// Append to Daily
var dailyDate = "DATE"; //date of the daily note to append to/create (eg."2022-05-20" or 'tp.file.now("YYYY-MM-DD")'
const append = * TEXT
; //text to append
const folder = app.vault.getAbstractFileByPath("20 Journals"); if (!tp.file.exists(dailyDate)) { await tp.file.create_new(append,dailyDate, false, folder) } else { const originalContent = await app.vault.read(tp.file.find_tfile(dailyDate));