const dayInMonth = moment().format("D");
const currentMonth = moment().format("M");
var i = 1;
while (currentMonth > i) {
var entries = entriesSum(i);
var max = daysInMonth(i);
var perc = entries + "/" + max;
#!/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)", |
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));
// 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
#!/bin/bash | |
# Author: Joschua | |
# Gist script link: https://gist.github.com/selfire1/f9ddddedc19a59eb6b3103ab51dec11d | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# |
name: Release Obsidian plugin | |
on: | |
push: | |
tags: | |
- "*" | |
env: | |
PLUGIN_NAME: FINDME # Change this to match the id of your plugin. |
<%* const title = tp.file.title; const uri = 'obsidian://open?vault=Vault&file=' + encodeURI(title); const fullstring = '[' + title + ']' + '(' + uri + ')'; navigator.clipboard.writeText(fullstring); %>