Skip to content

Instantly share code, notes, and snippets.

View panahi's full-sized avatar

Evan Panahi panahi

View GitHub Profile
@panahi
panahi / Published Shortcuts.md
Last active July 8, 2023 18:56
A collection of shortcuts that I've made
@panahi
panahi / DailyNoteTemplate.md
Created November 7, 2022 03:04
Obsidian Templates Collection

<%* var fileDate = moment(tp.file.title); // moment dates are mutable let prevDay = moment(fileDate).subtract(1, 'd').format('YYYY-MM-DD'); let nextDay = moment(fileDate).add(1, 'd').format('YYYY-MM-DD'); let prevDayWeek = moment(fileDate).subtract(1, 'd').format('gggg-[W]ww'); let nextDayWeek = moment(fileDate).add(1, 'd').format('gggg-[W]ww'); let yearLink = fileDate.format('YYYY'); let quarterLink = fileDate.format('YYYY [Q]Q'); let monthLink = fileDate.format('YYYY-MM');

@panahi
panahi / editTask.js
Created November 7, 2022 02:57
QuickAdd macro scripts
/**
* 1: verify that the file exists and that task is present
* 2: convert the task to a taskobject and open modal
* 3: Modal contains
* a: edit tags
* b: edit text
* c: edit priority
* 4: Update file with new task content
*/
async function editTask(params) {
@panahi
panahi / FileUtilities.js
Last active November 7, 2022 03:08
Scripts loaded via the CustomJS plugin in Obsidian to interact with tasks and build dataviewjs visualizations of tasks
class FileUtilities {
async getFileContents(app, path) {
let fileContents = await app.vault.adapter.read(path);
return fileContents;
}
async writeFile(app, path, newContents) {
return await app.vault.adapter.write(path, newContents);
}
@panahi
panahi / Test.java
Created September 19, 2012 17:12
An example of the java for-each loop
public class Test
{
public static void main(String[] args)
{
int[] example = {1, 2, 3, 4, 5, 6, 7, 8, 9};
for (int i = 0; i < 10; i++)
{
for (int current : example)
{