Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull-Request [TWP-9-4-2024] from Obsidian #125

Merged
merged 16 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions content/Configs/Files/Resonant Orbit Calculator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import math

def main():
while True:
target_radius = int(input("Input target body radius (km): [200] ") or "200")
relay_input = int(input("Input number of relays: [3] ") or "3")

altitude_tolerance = int(input("Input maneuvering tolerance (km): [5] ") or "5")
hardware_altitude_min = int(input("Input minimum altitude for hardware (km): [70] ") or "70")
hardware_altitude_max = int(input("Input maximum altitude for hardware (km): [250] ") or "250")

def get_altitude(target_radius, relays):
return round((target_radius / math.cos(math.radians(180 / relays)) - target_radius) * 100) / 100

relay_minimum = 0
for i in range(3,9):
if get_altitude(target_radius, i) <= hardware_altitude_max:
relay_minimum = i
break

# Ensure altitude_collect does not exceed hardware_altitude_max
altitude_connect = get_altitude(target_radius, relay_input)
while True:
altitude_collect = get_altitude(target_radius, relay_minimum)
if hardware_altitude_max - altitude_collect >= altitude_tolerance * 2:
break
relay_minimum += 1

print(f"To maintain connectivity you need {relay_input} relays at minimum altitude {altitude_connect}")
print(f"To maintain data collection you need {relay_minimum} relays at altitude {altitude_collect} - {hardware_altitude_max}")

use_connect = input("Calculate for connectivity only? [True] ") or "True"
relays = 0
eriapsis = 0
if use_connect == "True":
use_connect = True
relays = int(relay_input)
periapsis = input(f"Actual altitude to use: [{altitude_connect + altitude_tolerance}] ") or str(altitude_connect + altitude_tolerance)
else:
use_connect = False
relays = int(relay_minimum)
periapsis = input(f"Actual altitude to use: [{altitude_collect + altitude_tolerance}] ") or str(altitude_collect + altitude_tolerance)

print(f"Create a circularization node at an altitude of {periapsis}km and record your post-burn period as Days-Hours-Minutes-Seconds(.Miliseconds).")
time_input = input("D-H-M-S: ") or "0-1-45-45"
time = time_input.split("-")
time_input_seconds = ((float(time[0]) * 24 + float(time[1])) * 60 + float(time[2])) * 60 + float(time[3])
time_seconds = round((time_input_seconds / int(relays) * (int(relays)+1)) * 1000) / 1000
period_days, period_seconds = divmod(time_seconds, 24 * 60 * 60)
period_hours, period_seconds = divmod(period_seconds, 60 * 60)
period_minutes, period_seconds = divmod(period_seconds, 60)

period_days = round(period_days)
period_hours = round(period_hours)
period_minutes = round(period_minutes)
period_seconds = round(period_seconds * 1000) / 1000
print(f"Adjust your apoapsis so that your period is {str(period_days)}D {str(period_hours)}H {str(period_minutes)}M {str(period_seconds)}S (resonant orbit of {relays + 1}/{relays}).")
print(f"Then, detach one relay each time you're about to pass periapsis, and circularize it to an orbital period of {time[0]}D {time[1]}H {time[2]}M {time[3]}S.")
print("Don't forget to put solar panels into optimal orientation and enable instruments!")

restart = input("Restart? [True] ") or "True"
if restart != "True":
break

if __name__ == "__main__":
main()
149 changes: 149 additions & 0 deletions content/Configs/Guides/Guide Dataview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
---
tags:
- guide
share: true
---
## Standard Fields
status: string = TODO, IN_PROGRESS, DONE, CANCELLED
priority: string = lowest, low, normal, medium, high, highest

## Dataview Basics
For active projects:
```
LIST
FROM "Projects" and #project and !#navigation
WHERE !completion AND status != "DONE" AND status != "CANCELLED"
SORT status, due
```

```
file.inlinks AS "Mentions"
```

```
\-
```
= date(2024-06-19T10:00) - date(2024-06-19T09:00)

### Inline Calculations
release-date:: 2027-06-18T12:00
```
\- until release!!
```
P2Y9M1W6DT8H54M53.648S until release!!

## DataviewJS

dv.date("now").toFormat("x");

### Rename, Move, AND Link To Main Page
```
<%* await app.vault.modify(tp.file.find_tfile(tp.file.path(true)), ""); _%>
<%*
let filename = tp.file.title;
if (filename.startsWith("Untitled")) {
filename = await tp.system.prompt("Project Name [title]", "Project Title");
filename = filename.replace(/[^a-zA-Z0-9\/]+/g, "_");
// await tp.file.rename(filename);
};
const filepath = "Projects/" + tp.date.now("YYYY") + "/" + filename;
await tp.file.move(filepath + "/" + filename);
const tag = "#" + filepath;
_%>


// by https://forum.obsidian.md/u/flatline
// from https://forum.obsidian.md/t/whats-better-tags-at-the-end-of-text-or-tags-in-front-matter/55422/2

const pagesWithQuotes = await Promise.all(
dv
.pages("<% tag %>")
.map(pageWithQuote => new Promise(async (resolve, reject) => {
const content = await dv.io.load(pageWithQuote.file.path);
resolve({
link: pageWithQuote.file.link,
content,
modified: pageWithQuote.file.mtime
});
}))
);

// Create an array of pages containing quotes,
// where each page is:
// {
// quotes: [], // array of quotes
// link: { path: "" } // Link
// }

const quotesByPage = pagesWithQuotes.sort((a, b) => b.modified - a.modified).map(({
link,
content
}) => ({
link,
quotes: content
// Split into paragraphs
.split("# ")

// Get only paragraphs that have the tag AND is not #timelog
.filter(content => content.includes("<% tag %>") && !content.includes("#timelog"))

// Remove the first tag from each quote string
.map(content => content.replace("<% tag %>", "").replace(/\n/g,"\n> "))
}));
quotesByPage.forEach(
page =>
page.quotes.forEach(
quote => dv.paragraph(`> [!note]- From ${page.link}${quote}`)
)
);

const timelogByPage = pagesWithQuotes.sort((a, b) => b.modified - a.modified).map(({
link,
content
}) => ({
link,
quotes: content
// Split into paragraphs
.split("\n")

// Get only paragraphs that have the tag AND #timelog
.filter(content => content.includes("<% tag %>") && content.includes("#timelog"))

// Remove the first tag from each quote string
.map(content => content.replace("#timelog", "").replace("<% tag %>", ""))
}));
let timelog = "";
let timelogSum = {
hours: 0,
minutes: 0,
};
timelogByPage.forEach(
page =>
page.quotes.forEach(
quote => {
let regex = /date\(([^)]+)\)/g;
let matches = [...quote.trim().slice(1, -1).matchAll(regex)];
if (matches.length === 2) {
let timelogDateEnd = matches[0][1];
let timelogDateStart = matches[1][1];
let timelogMinutes = Math.floor((dv.date(timelogDateEnd) - dv.date(timelogDateStart)) / (1000 * 60));
let timelogHours = Math.floor(timelogMinutes / 60);
timelogMinutes = timelogMinutes % 60;
timelog += `> ${page.link} | ${String(timelogHours).padStart(2, '0')}:${String(timelogMinutes).padStart(2, '0')}\n`;
timelogSum.minutes += timelogMinutes;
timelogSum.hours += timelogHours;
}
}
)
);

timelogSum.hours += Math.floor(timelogSum.minutes / 60);
timelogSum.minutes = timelogSum.minutes % 60;
dv.span(`> [!note]+ Timelog:\n> Total: ${timelogSum.hours} Hours, ${timelogSum.minutes} Minutes\n> \n${timelog}`)
```

### Resources

[Datavuew Functions](https://blacksmithgu.github.io/obsidian-dataview/reference/functions/)
[DataviewJS Functions](https://blacksmithgu.github.io/obsidian-dataview/api/code-reference/)
[How to achieve a hierarchical Dataview list without bullets but maintaining indentation](https://forum.obsidian.md/t/how-to-achieve-a-hierarchical-dataview-list-without-bullets-but-maintaining-indentation/66011)
24 changes: 24 additions & 0 deletions content/Configs/Guides/Guide Excalibrain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
tags:
- guide
share: true
---
### Ontology

**Parents**
inception, North, origin, Parent, parent domain, parents, people, source, u, up

**Children**
Child, children, contributes to, d, down, leads to, nurtures, South

**Left-Side Friends**
advantages, alternatives, Friend, friends, j, Jump, Jumps, pros, similar, supports

**Right-Side Friends**
cons, disadvantages, missing, opposes

**Previous (Friends)**
Before, prev, Previous, w, West

**Next (Friends)**
After, e, East, n, next
65 changes: 65 additions & 0 deletions content/Configs/Guides/Guide Obsidian.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
tags:
- guide
share: true
---
[Markdown Cheatsheet](https://rentry.org/how)
# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6

## Styles

Body
**Bold**
_Italic_
~~Strikethrough~~

## Formats

- Bullet Point
- Bullet Point
- Nested Bullet Point
1. Numbered List
2. Numbered List
1. Nested Numbered List
- [x] Checkbox [completion:: 2024-01-01]
- [p] Pro
- [c] Con
- [I] Idea
Reason
>Quote
>Multi line

> [!Note]+ Callout

This[^1] is a simple[^2] footnote[^note].

[^1]: This is the referenced text.
[^2]: Add 2 spaces at the start of each new line.
This lets you write footnotes that span multiple lines.
Referenced footnote will appear at the bottom of the page in Reading View.
[^note]: Named footnotes still appear as numbers, but can make it easier to identify and link references.

Break Line
___

## References

Reference to a [[./Guides|File]]
Reference to a [[Guide Obsidian#Heading 1|Heading]]
Reference to a [[../../../2024-01-01#^025433|Paragraph]]
Inline Reference![[Guide Obsidian#Styles|Configs/Guides/Guide Obsidian > Styles]]
## Shortcuts

Ctrl = Enable Hover Preview On Links
Ctrl + E = Toggle Source Mode
Alt + E = Templater
Alt + Q = QuickAdd
Ctrl + Alt + A = Emoji Toolbar
Ctrl + Alt + T = Modify Task
Ctrl + Drag + Drop = Embed / Transclude
[Multiple Cursors](https://help.obsidian.md/Editing+and+formatting/Multiple+cursors)
54 changes: 54 additions & 0 deletions content/Configs/Guides/Guide Tasks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
tags:
- guide
share: true
---
[Guide](https://publish.obsidian.md/tasks/Introduction)

[Filters](https://publish.obsidian.md/tasks/Queries/Filters)
[RegEx](https://publish.obsidian.md/tasks/Queries/Regular+Expressions)

### Default Filter
```
NOT done
starts before tomorrow
short mode
sort by priority
sort by status.type
description regex does not match /^$/
NOT (path includes Templater)
NOT (tag includes HideFromTasks)
```

### Tasks Page Dataview Setup

```
%%[parent:: [[index]]]%%

> [!blue]+ Active Projects
> - [[Projects/2024/ICPS_Research/ICPS_Research.md|ICPS_Research]]
> - [[Courses/2024/ARC2013Y-Architectural_Design_Studio_3/ARC2013Y-Architectural_Design_Studio_3.md|ARC2013Y-Architectural_Design_Studio_3]]
> - [[Courses/2024/ARC2047H-Building_Science_Materials_and_Construction_3/ARC2047H-Building_Science_Materials_and_Construction_3.md|ARC2047H-Building_Science_Materials_and_Construction_3]]
> - [[Courses/2024/ARC2023H-Design_Technology_2/ARC2023H-Design_Technology_2.md|ARC2023H-Design_Technology_2]]
> - [[Courses/2024/ARC2017H-Research_Methods/ARC2017H-Research_Methods.md|ARC2017H-Research_Methods]]
>

> [!yellow]+ Due
> ```tasks
> has due date
> (scheduled before next 2 week) OR (no scheduled date)
> ```

> [!pink]+ Scheduled
> ```tasks
> no due date
> scheduled before next 2 week OR no scheduled date
> NOT (tag includes shopping)
> ```

> [!green]+ Shopping
> ```tasks
> tag includes shopping
> ```

```
Loading