Skip to content

Instantly share code, notes, and snippets.

@HeyItsGilbert
Last active May 1, 2025 15:24
Show Gist options
  • Save HeyItsGilbert/8d492ebc7ad9c4830c0ae1fcc8fc6ac8 to your computer and use it in GitHub Desktop.
Save HeyItsGilbert/8d492ebc7ad9c4830c0ae1fcc8fc6ac8 to your computer and use it in GitHub Desktop.
These are my templater templates.

<%* let dest_path = '1000 Daily Notes/' let title = tp.file.title let format = 'YYYY-MM-DD' let today = tp.date.now(format, 0, title, format) let yesterday = tp.date.now(format, -1, today, format) let tomorrow = tp.date.now(format, 1, today, format) let day = tp.date.now("dd", 0, title, format) tp.file.move(dest_path + title ) tp.user.PinMe() if (today == tp.date.now(format) ) { app.commands.executeCommandById("obsidian-day-planner:app:link-day-planner-to-note") } _%>

Type: daily_note Day: <% tp.date.now('D', 0, title, format) %> Month: <% tp.date.now('MMMM', 0, title, format) %> Week: <% tp.date.now('w', 0, title, format) %> Year: <% tp.date.now('YYYY', 0, title, format) %>

<% tp.date.now('dddd, MMMM D, YYYY', 0, title, format) %>

<< [[<% dest_path + yesterday %>|<%yesterday%>]] | [[<% dest_path + tomorrow %>|<% tomorrow %>]] >>

Direction

![[<% dest_path + tp.date.now('YYYY') %>-W<% tp.date.now('ww') %>#This week]]

Tasks due today

not done  
due before <% tp.date.weekday("YYYY-MM-DD", 6) %>

dice: [[Daily Quotes]]|line

Schedule

<%* switch (day) { case 'We': tR += await tp.file.include("[[Templates/Wed Schedule]]"); break; case 'Fr': tR += await tp.file.include("[[Templates/Friday Schedule]]"); break; default: tR += await tp.file.include("[[Templates/Default Schedule]]"); break; } -%>

Log

<% tp.file.cursor() %>

Unfinished Docs

TABLE Status as Status FROM "4000 Posts"
WHERE Status = "in-progress"

Pending Items

not done
heading does not include Schedule
heading does not include End-of-week checklist
heading does not include This month
heading does not include This week
path does not include Templates
group by filename

<%* let title = tp.file.title

switch (title) { case title.match(/^\d{4}-\d{2}$/)?.input: tR += await tp.file.include("[[Monthly Review]]"); break; case title.match(/^\d{4}-W\d{2}$/)?.input: tR += await tp.file.include("[[Weekly Review]]"); break; default: tR += await tp.file.include("[[Daily Note]]"); break; } -%>

<% tp.user.pwsh("Get-ObsidianSchedule -Day " + tp.file.title + " -StartOfDayHour 9 -EndOfDayHour 16") %>

  • 16:30 Shutdown
    • Review [[<% tp.date.now('YYYY') %>-W<% tp.date.now('ww') %>#This week]]
    • Jot down pending items
    • Update tasks w/ next steps
    • Close tabs
    • Clean desk

<% tp.user.pwsh("Get-ObsidianSchedule -Day " + tp.file.title + " -StartOfDayHour 9 -EndOfDayHour 16") %>

  • 16:30 Shutdown
    • Review [[1000 Daily Notes /<% tp.date.now('YYYY') %>-W<% tp.date.now('ww') %>#This week]]
    • Write a [[2000 Status Reports/<% tp.date.now('YYYY') %>-W<% tp.date.now('ww') %>#This week]]
    • Jot down pending items
    • Update tasks w/ next steps
    • Get to [[Inbox Zero]] on all emails
    • Delete Downloads folder
    • Patch systems
    • Restart computer
    • Close tabs
    • Tidy desk/room
type Day Month Week Year Tags
meeting
<% tp.date.now('D') %>
<% tp.date.now('MMMM') %>
<% tp.date.now('w') %>
<% tp.date.now('YYYY') %>

<%* let title = tp.file.title if (title.match(/^id_/).input) { tp.file.move( '3000 Meeting Notes/' + title.replace(/id_/, "") + " - " + tp.date.now('YYYY-MM-DD') ) -%> <% tp.user.pwsh("Get-MeetingInfo -Title '" + title.replace(/id_/, "") + "'")%> <%* } else { -%>

[[<% tp.file.title.split(" - ")[0] %>]] - <% tp.file.title.split(" - ")[1] %>

Attendees

  • <% tp.file.cursor() %>

Notes

<%* } -%>

<%* let dest_path = '1000 Daily Notes/' let title = tp.file.title let format = 'YYYY-MM' let today = tp.date.now(format, 0, title, format) let last_month = tp.date.now(format, -1, today, format) let next_month = tp.date.now(format, +31, today, format) tp.file.move(dest_path + title ) _%>

<< [[<% dest_path + last_month %>|<%last_month%>]] | [[<% dest_path + next_month %>|<% next_month %>]] >>

Review: <% tp.date.now('YYYY-MM') %>

Direction

Keep these things in mind as you do this month's review:

[[My Core Work Principles]]

Yearly OKRs

![[Yearly OKRs <% tp.date.now('YYYY') %>]]

Last month

Initiatives

![[<% last_month %>#This month]]

title: Questions to ask
collapse: true
Did you finish the initiatives? If so, how do you think you did? If not, what do you need to change to finish them this month?

Other reflections

title: Questions to ask
collapse: true
How do you feel about your accomplishments? What prevented you from working optimally?

This month

title: Questions to ask
collapse: true
What initiatives are you setting this month?
  • [ ]

<%* let mytitle = await tp.system.prompt('Name:', tp.file.title, false) let people_dir = '5000 People' if (tp.file.folder != people_dir ){ tp.file.move(people_dir + '/@' + mytitle) } _%>

name: <% mytitle.trim() %> aliases: <% mytitle.trim() %> lead-character: '@' type: person

<% mytitle.trim() %>

Role:: Team:: Manager::

Reports

TABLE WITHOUT ID file.link AS "Name"
WHERE Manager = this.file.link
LIMIT 10

Resources

TABLE
FROM [[]]
LIMIT 10
type Day Month Week Year tags Status URL
post
<% tp.date.now('D') %>
<% tp.date.now('MMMM') %>
<% tp.date.now('w') %>
<% tp.date.now('YYYY') %>
in-progress

<% tp.file.cursor() %>

tl;dr

Who

<Who does this affect? This is a good way as a customer to know if I should care.>

What

<>

When

<>

Why

<>

Let me know if you have any questions or concerns.

// In: cmd = a complete command to run in the command line shell. It is up
// to the user to make certain the command is properly formatted
// for their platform
// Out: an object with two properties:
// out = the trimmed content the command sent to standard out.
// err = the trimmed content the command sent to standard error.
async function pwsh(cmd) {
const isWin = process.platform === "win32";
const { promisify } = require('util');
const exec = promisify(require('child_process').exec);
// Escape backslash
const encodedCommand = new Buffer.from(cmd, 'utf16le');
if (isWin) {
bin = 'pwsh.exe'
} else {
bin = '/usr/local/bin/pwsh'
}
const parameters = [
bin,
// "-NoProfile",
'-NonInteractive',
"-EncodedCommand",
encodedCommand.toString('base64'),
'-OutputFormat Text'
]
//return 'pwsh.exe ' + parameters.join(' ');
console.log(`env: ${JSON.stringify(process.env)}`);
console.log(`Executing: ${parameters.join(' ')}`);
console.time("Pwsh");
const result = await exec(parameters.join(' '));
console.timeEnd("Pwsh")
if (result.error) {
console.error(`exec error: ${result.error}`);
return;
}
console.log(`stdout: ${result.stdout}`);
console.error(`stderr: ${result.stderr}`);
return result.stdout.trim();
//return { out: result.stdout.trim(), err: result.stderr.trim() };
}
module.exports = pwsh;

Gilbert Status Report - <% tp.date.weekday("M/DD", 5) %>

<% tp.file.cursor() %>


Answer:

  • Did you explain the impact?
  • Is it staff level work?

Did:

TABLE did AS "Did"
FROM "1000 Daily Notes"
WHERE Year = <% tp.date.now("YYYY") %> and did != null and Week = <% tp.date.now("w") %>
SORT asc

Meetings

LIST 
WHERE Type = "meeting" and Year = <% tp.date.now("YYYY") %> and type = meeting and Week = <% tp.date.now("w") %>
SORT asc

To Do's

heading does not include Schedule
heading does not include End-of-week checklist
heading does not include This month
heading does not include This week
path does not include Templates
done in this week
group by filename

<% tp.user.pwsh("Get-ObsidianSchedule -Day " + tp.file.title + " -StartOfDayHour 9 -EndOfDayHour 14") %>

  • 14:30 Shutdown
    • Review [[<% tp.date.now('YYYY') %>-W<% tp.date.now('ww') %>#This week]]
    • Jot down pending items
    • Update tasks w/ next steps
    • Close tabs
    • Clean desk
---
type: weekly_review
Day: <% tp.date.now('D') %>
Month: <% tp.date.now('MMMM') %>
Week: <% tp.date.now('w') %>
Year: <% tp.date.now('YYYY') %>
---
# Review: <% tp.file.title %>
## Monthly initiatives
Keep these things in mind as you do this week's review:
![[1000 Daily Notes/<% tp.date.now("YYYY-MM") %>#This month]]
## Last week
![[<% tp.date.now("YYYY") %>-W<% tp.date.now("W", -7, tp.file.title, "YYYY-Www") %>#This week]]
```ad-question
title: Questions to ask
collapse: true
What were your goals last week, and did you finish them? What are you changing so that you can do them this month?
```
## This week
```ad-question
title: Three goals
collapse: true
If you could only get three specific goals done this week, what would they be? How do they relate to your monthly initiatives and yearly OKRs?
```
- [ ]
- [ ]
- [ ]
# Yearly OKRs {{date:YYYY}}
Write no more than 5 OKRs for this year, and create a page for each.
Put your cursor on the line you want the new OKR to be in, and then hit `CMD '`. Select `Add Yearly OKR`. The new page will be created.
## Work
## Health
## Wealth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment