Skip to content

Instantly share code, notes, and snippets.

View chrisgrieser's full-sized avatar

Chris Grieser chrisgrieser

View GitHub Profile
@chrisgrieser
chrisgrieser / mastodon_redirect-to-home-instance.js
Last active November 23, 2024 19:13
Userscript for [Violent|Tamper|Grease]monkey.
// ==UserScript==
// @name Redirect to Mastodon home instance
// @namespace Violentmonkey Scripts
// @match https://*/@*/*
// @version 1.0
// @author pseudometa
// @description 2024-11-22
// @icon https://mastodon.social/packs/media/icons/favicon-48x48-c1197e9664ee6476d2715a1c4293bf61.png
// ==/UserScript==
@chrisgrieser
chrisgrieser / metadata-refactor.sh
Last active May 11, 2024 05:54
Change Wikilinks in YAML Frontmatter from the Breadcrumbs style to the new Obsidian Metadata Style
# macOS
cd "path/to/your/vault"
awk 'FNR <= 1 && /^---$/{print FILENAME}' **/*.md |
xargs -I {} sed -i '' -E '1,/^---$/ s/(\[\[.*]])/"\1"/g' "{}"
# Linux (or macOS users with GNU sed)
cd "path/to/your/vault"
awk 'FNR <= 1 && /^---$/{print FILENAME}' **/*.md |
xargs -I {} sed -i -E '1,/^---$/ s/(\[\[.*]])/"\1"/g' "{}"