dv.taskList(dv.pages().file.tasks
.where(t => !t.completed)
.where(t => t.text.includes("{{date:YYYY-MM-DD}}")))
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getNumOfGames(campaign) { | |
let numOfGames = app.plugins.plugins.dataview.api | |
.pages(`"ttrpgs/${campaign}"`) | |
.where(page => { | |
if (page.type === 'session') { | |
if (page.campaign === campaign) { | |
return true; | |
} | |
} | |
}).length |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = async function updateDate(params) { | |
/* | |
This function does the following things: | |
1. Gets the current date. | |
2. Reads the contents of the current file. | |
3. When a line that contains `date::` is found, adds the current date as a note to the end of the line. | |
*/ | |
let currDate = moment().format('YYYY-MM-DD'); | |
const currentFile = params.app.workspace.getActiveFile(); | |
const fileContents = await params.app.vault.read(currentFile); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```dataviewjs | |
function randomElements(arr, n) { | |
var result = new Array(n); | |
var len = arr.length; | |
if (n > len) throw new RangeError("randomElements: more elements taken than available"); | |
for (var i = len - 1; i >= len - n; i--) { | |
var j = Math.floor(Math.random() * (i + 1)); | |
var temp = arr[i]; | |
result[len - i - 1] = arr[j]; | |
arr[i] = arr[j]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This script returns a list of activity options you could do (each defined by a Markdown file), | |
depending on how much time you have available. | |
REQUIRES: | |
- Obsidian: https://obsidian.md | |
- Obsidian Dataview plugin: https://blacksmithgu.github.io/obsidian-dataview/ | |
- Obsidian Templater plugin: https://silentvoid13.github.io/Templater/ | |
- this folder structure: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Opens files in directory, outputs firebase URLs to a file, downloads them, and replaces the links with a link to the new files. | |
# To use, replace PATH in the variable vaultDir with your vault's root directory. | |
# This automatically puts filenames in /assets - change the newFilePath variable if you want to change this | |
import re | |
import glob | |
import os | |
import requests | |
import calendar | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import http from 'k6/http'; | |
import { sleep, check } from 'k6'; | |
import { parseHTML } from "k6/html"; | |
import papaparse from 'https://jslib.k6.io/papaparse/5.1.1/index.js'; | |
import { SharedArray } from "k6/data"; | |
const domain = 'https://test.k6.io'; // Parameterize the domain to make it easier to change environments. | |
let token = 'NOT FOUND'; // Initialize the csrftoken variable. | |
/* |
+++ title = "Load Tests as Code" outputs = ["Reveal"] [reveal_hugo] custom_theme = "reveal-hugo/themes/robot-lung.css" margin = 0.2 highlight_theme = "color-brewer" transition = "slide" transition_speed = "fast" +++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Takes exported Roam input and turns it into a better format for publishing. | |
# Output is still Markdown, but it's one that doesn't support backlinks. | |
# Good for traditional blogs. | |
# Run from a directory with a source .md file. | |
# Pipe output to a new file, i.e., output.md | |
import re | |
import glob | |
try: | |
filename = glob.glob('*.md') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Parses a .md generated by [YiNote](https://yinote.co/) and reformats it for export into [Roam Research](https://roamresearch.com). | |
# Prereq: Input .md file in the same folder | |
# Run this and pipe the output to a file you specify, i.e. `python3 yinotetoroam.py > output.md` | |
# Import `output.md` to Roam. | |
import re | |
import datetime | |
import glob | |
try: | |
filename = glob.glob('*.md') |
NewerOlder