Skip to content

Instantly share code, notes, and snippets.

View chrisgrieser's full-sized avatar

Chris Grieser chrisgrieser

View GitHub Profile
/* RAINBOW INDENT COLORS */
:root {
/* default */
--font-use-default: var(--default-font);
--font-size-use-default: var(--editor-font-size);
--indent-use-default: 1.8ch;
/* ------- */
/* theme */
--font-use-theme: inherit;
// Function to convert number of seconds into Hours::Minutes::Seconds
function minutesSeconds(s){
return(s-(s%=60))/60+(9<s?':':':0')+s;
}
// The Main Function
function start(){
// Current Page
var currentURL = window.location.href;
@beaussan
beaussan / Usage.md
Last active October 20, 2021 00:08
Generate a list of backlinks that are not yet in the document for Obsidian Templater's plugin

<% tp.user.getNotSetBaclinks(tp.file.path(true), this.app)%>

@jglev
jglev / Example Output.md
Last active October 24, 2024 12:50
Use Obsidian Notes' Templater Plugin (https://github.com/SilentVoid13/Templater) to add links to GitHub Issues from specific public or private repositories using a searchable prompt

Screenshot of suggester prompt

Resulting output:

[`octocat/Hello-World #1053`](https://github.com/octocat/Hello-World/issues/1053)
@maybemkl
maybemkl / remove_links.py
Created September 6, 2021 23:00
Remove markdown wiki-link brackets during pandoc exports
@kepano
kepano / obsidian-web-clipper.js
Last active September 2, 2025 05:35
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/[email protected]?module'), import('https://unpkg.com/@tehshrike/[email protected]'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@TfTHacker
TfTHacker / ArchiveAndProcessNextFile.js
Last active April 5, 2025 06:41
Obsidian: Archive current file and then open next file in folder (Templater script)
<%*
/*
Updated: 9/20/2022
Author: TfTHacker
Gist: https://gist.github.com/TfTHacker
Twitter: https://twitter.com/TfTHacker
Requirements: Templater Plugin for Obsidian
Description: This script performs the following actions:
1. Moves current file to the archive folder (defined in the variable archivePath)
if archivePath is null, a folders in the vault will be presented for selection
@GitMurf
GitMurf / obsidian.templater.move-line.js
Last active March 22, 2025 17:26
Move the active line of the active file to a chosen file.
<%*
//v1.6.2: Fix with update to Templater where wasn't removing the selected text/line "on move"
//'first' will add to top of file. 'last' will add to bottom of file
let firstOrLastLine = 'last';
//Choose a specific line to move to underneath; overrules firstOrLastLine if true
const bChooseLine = false;
//After moving the line, open the file it was moved to
@GitMurf
GitMurf / obsidian.templater.create-and-copy-block-ref-id.js
Last active May 3, 2025 07:50
Credit to: @shabegom - Add a block ref to the current line by adding a ^uniqueId on the end and copying to the clipboard the embed reference link so you can quickly paste the block ref somewhere else in your vault. Similar to Roam ctrl + click and drag to create block ref.
<%*
//v1.1: Changed to using the new "view.editor" instead of deprecated "view.sourceMode.cmEditor"
let cmEditorAct = this.app.workspace.activeLeaf.view.editor;
let curLine = cmEditorAct.getCursor().line;
cmEditorAct.setSelection({ line: curLine, ch: 0 }, { line: curLine, ch: 9999 });
function createBlockHash() {
let result = '';
var characters = 'abcdefghijklmnopqrstuvwxyz0123456789';