minor updates
This commit is contained in:
parent
db2ee648fe
commit
f162d066bf
|
@ -3,6 +3,8 @@ title = "About"
|
|||
path = "about"
|
||||
+++
|
||||
|
||||
- Security analyst with the [Security Operations & Control Center (SOCC) of the Vrije Universiteit Amsterdam](https://vu.nl/en/about-vu/more-about/security-and-operations-control-center?slug=socc)
|
||||
- Beginner programmer (check out my code [here](https://code.joostagterhoek.nl/joost))
|
||||
|
||||
- Security analyst with the [Security Operations & Control Center (SOCC) of the Vrije Universiteit Amsterdam](https://vu.nl/en/about-vu/more-about/security-and-operations-control-center?slug=socc),
|
||||
- Working on SOC and SIEM improvements, implementing security measures, cloud security and process automation (Power Automate, Logic Apps, Python)
|
||||
- Beginner programmer in Python and C (check out my programming projects [here](https://code.joostagterhoek.nl/joost))
|
||||
- Interested malware developer and researcher (currently working through [Maldev Academy](https://maldevacademy.com))
|
||||
|
|
|
@ -8,18 +8,18 @@ tags = ['programming', 'Obsidian', 'JavaScript']
|
|||
|
||||
# Baby steps
|
||||
|
||||
A little while ago, I wrote [a blog post](https://joostagterhoek.nl/posts/basic-javascript/) about my first experience with Obsidian, more specifically with DataviewJS. DataviewJS is an API in Obsidian that allows you to excute JavaScript and access the dataview indices and query engine. Basically, if the default Dataview query language to list, filter, sort or group data isn't enough for you, you're free to write your own logic. For me, the goal was to take all the time trackers created with the amazing ObsidianSimpleTimeTracker-plugin and show the worked hours per task or project. This worked, but not entirely in the tabular format I wanted.
|
||||
A little while ago, I wrote [a blog post](https://joostagterhoek.nl/posts/basic-javascript/) about my first experience with Obsidian, more specifically with DataviewJS. ✍️ DataviewJS is an API in Obsidian that allows you to excute JavaScript and access the dataview indices and query engine. Basically, if the default Dataview query language to list, filter, sort or group data isn't enough for you, you're free to write your own logic. For me, the goal was to take all the time trackers created with the amazing ObsidianSimpleTimeTracker-plugin and show the worked hours per task or project. This worked, but not entirely in the tabular format I wanted. ❓
|
||||
|
||||
# Fiddling
|
||||
|
||||
I was happy that my basic JavaScript fiddling worked, but it didn't yet provide me with what I needed: a solid overview of the hours worked per task or project, per day. As a security analyst I am increasingly more involved with various projects that require me to keep note of my worked hours. A table would be the optimal overview for what would be a very long list of data per worked day, over the course of multiple weeks and months.
|
||||
I was happy that my basic JavaScript fiddling worked, but it didn't yet provide me with what I needed: a solid overview of the hours worked per task or project, per day. As a security analyst I am increasingly more involved with various projects that require me to keep note of my worked hours. A table would be the optimal overview for what would be a very long list of data per worked day, over the course of multiple weeks and months. 👀
|
||||
|
||||
# Execution flow
|
||||
|
||||
Eventually, I managed to fix my issue and organize the output of every daily time tracker in a single row, with formatted time values (xh, xxm xxs) per project or task. As I know in advance what my daily tasks are, I didn't have to make this part dynamic. But it did present me with the problem of how to have a row entry for each day, where I wasn't sure what project or task I worked on that day. Basically, if I have project 1, 2, 3 and 4, how can I make sure the table rows for Tuesday (worked only on project 1) and Thursday (worked on projects 2, 3 and 4) are the same? What helped me, was think it all through: what data do I want to represent in the table, what data type do I need for that, how (and when) in my logic will I fill that data?
|
||||
Eventually, I managed to fix my issue and organize the output of every daily time tracker in a single row, with formatted time values (xh, xxm xxs) per project or task. As I know in advance what my daily tasks are, I didn't have to make this part dynamic. But it did present me with the problem of how to have a row entry for each day, where I wasn't sure what project or task I worked on that day. Basically, if I have project 1, 2, 3 and 4, how can I make sure the table rows for Tuesday (worked only on project 1) and Thursday (worked on projects 2, 3 and 4) are the same? What helped me, was think it all through: what data do I want to represent in the table, what data type do I need for that, how (and when) in my logic will I fill that data? 💭
|
||||
|
||||
# The way I did it
|
||||
In the end, I chose for string values per entry name (name of a task or project) and their durations. Every time I iterate over an existing time tracker entry, I check for the entry name and fill the string value of the corresponding duration (`entry_name == duration, socc_duration = getTickerEntryDuration`, basically). Iterating over every existing tracker in my Obsidian vault, I first iterate over the individual tracker entries and fill the string variables as stated. Once this is done, I push these values to a premade JavaScript object, with key-value pairs like `date: dateBasedOnObsidianNoteName, socc:socc_duration`. Then, I build an Obsidian Dataview table with the `dv.table()` function, which I pass this dynamically updated JavaScript object, which then displays rows for each iterated tracker and its entries.
|
||||
In the end, I chose for string values per entry name (name of a task or project) and their durations. Every time I iterate over an existing time tracker entry, I check for the entry name and fill the string value of the corresponding duration (`entry_name == duration, socc_duration = getTickerEntryDuration`, basically). Iterating over every existing tracker in my Obsidian vault, I first iterate over the individual tracker entries and fill the string variables as stated. Once this is done, I push these values to a premade JavaScript object, with key-value pairs like `date: dateBasedOnObsidianNoteName, socc:socc_duration`. Then, I build an Obsidian Dataview table with the `dv.table()` function, which I pass this dynamically updated JavaScript object, which then displays rows for each iterated tracker and its entries. 🏗️
|
||||
|
||||
# The code
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user