Skip to content

Instantly share code, notes, and snippets.

View TfTHacker's full-sized avatar

TfTHacker

View GitHub Profile
@GitMurf
GitMurf / obsidian.live-preview.css.block-ref-inline.css
Last active April 27, 2024 07:28
CSS for inline block references that works for both NEW CM6 Live Preview and also Preview Mode for both CM5 (Legacy) and CM6 (New)
:root {
/* #7159de (similar to Obsidian purple) */
--block-ref-line-color: grey;
--block-ref-line-type: solid;
--block-ref-line-size: 2px;
/* Set to "inherit" for no bg color */
--block-ref-hover-bg-color: #d4d0d026;
}
/*
@GitMurf
GitMurf / obsidian.templater.quick-capture.js
Last active April 22, 2024 15:14
Obsidian Quick Capture using templater. Activate from anywhere in your vault to record quick ideas, notes, time logging, etc. The Quick Capture file does NOT need to be open.
<%*
//v1.4: Adding option for including a header for each DNP day to fold
//'first' will add to top of file. 'last' will add to bottom of file
let firstOrLastLine = 'first';
//Name of the Quick Capture file. Do NOT include extension '.md'
let qcFileName = 'Quick Capture';
//Leave this blank if you want to use the default file path location (set to '/' to use root of vault)
@azlen
azlen / bulletpaths.js
Last active April 15, 2024 14:06
All Paths Lead to Roam
/*
* credit to Dhrumil Shah (@wandcrafting) and Robert Haisfield (@RobertHaisfield)
* for the original concept which was part of their RoamGames submission
* and can be found at: https://www.figma.com/file/5shwLdUCHxSaPNEO7pazbe/
*
*/
/* ======= OPTIONS ======== */
/* note: if you change these, reload the page to see the effect */
@TakuanPickle
TakuanPickle / Vocab Note Workflow.md
Last active October 14, 2023 21:53
A sample workflow for creating links to vocabulary notes in a transcription with prompts for fields.

Vocab Note Workflow

I created a quick way to make flashcards and vocab notes for my Japanese learning. I had been struggling with how slow making Anki cards can be and found myself more likely to actually review cards if they were all in Obisidian, which I always have open, rather than opening Anki.

Required Plugins

  1. Templater
  2. QuickAdd
  3. Spaced Repetition
  4. Dataview
  5. Supercharged Links (Optional)
/*
* Viktor's Roam Mobile Long tap to Exluce Filters and Right click on bullets + pages + title
* version: 0.3
* author: @ViktorTabori
*
* How to install it:
* - go to page [[roam/js]]
* - create a node with: { {[[roam/js]]}}
* - create a clode block under it, and change its type from clojure to javascript
* - allow the running of the javascript on the {{[[roam/js]]}} node
@GitMurf
GitMurf / attr-table-filters.js
Last active June 13, 2023 03:16
Filtering attribute tables
/*
****************************************************************************************
****************************************************************************************
****************************************************************************************
NOW HOSTING CODE VIA MY MAIN GITHUB REPOSITORY FOR ROAM SO THAT USERS CAN LINK DIRECTLY TO THE CODE AND AUTO UPDATE
GO HERE FOR INSTALLATION INSTRUCTIONS: https://github.com/GitMurf/roam-javascript#installation
****************************************************************************************
@ciceronianus
ciceronianus / Roam-colored_fonts.css
Last active April 28, 2023 08:24
(deprecated) Roam - colored bold, italics and highlight by @CatoMinor3
/*
Author:: @CatoMinor3
Version:: 3.0
Date:: Sept.rm-italicsber 22nd, 2020
Changes log:
- 3.0 - code adapted for the new classes in Roam
- 2.1 - code adaptated for future support of colour shades (different opacity),
download the additonal CSS here: https://gist.github.com/ciceronianus/5d7b224658b7a9832a6249a13091aa9d
Support:
@thesved
thesved / roam-open-page-in-sidebar.js
Last active February 20, 2023 21:24
Open a page in Roam's sidebar POC
/*
* Open a page in Roam's sidebar POC, h/t @dvargas92495
* version: 0.4 Mutation Observer, returns Promise
* author: @ViktorTabori
* use: await openPageSidebar("Page Title")
*/
openPageSidebar = (function(){
var observer,
doLog = true, // console.log
running = false, // status;
@GitMurf
GitMurf / obsidian.templater.nlp-date-input.js
Created April 22, 2021 19:04
Requires @argenos Natural Language Dates Plugin. Pop up input box asks for date and then parses it as a date and turns it into a [[Daily Notes Page]] page ref.
<%*
//v1.0
let dueDateStr = await tp.system.prompt("Due Date");
let parseResult;
let parseResultLink;
if(dueDateStr) {
let nlDatesPlugin = this.app.plugins.getPlugin('nldates-obsidian');
parseResult = nlDatesPlugin.parseDate(dueDateStr);
if(parseResult){parseResultLink = '[' + '[' + parseResult.formattedString + ']]';}
@ottsch
ottsch / add_favicons.js
Last active July 16, 2022 17:56
Add favicon to links in Roam Research
new MutationObserver(() => {
let filtered = Array.prototype.filter.call(
document.querySelectorAll(".roam-body a"),
(a) => {
return a.hostname && !a.hostname.includes("roamresearch.com");
}
);
Array.prototype.forEach.call(filtered, (a) => {
if (a.text == "*") {
a.style.background = `url(https://www.google.com/s2/favicons?sz=16&domain=${a.hostname}) right center no-repeat`;