Skip to content

Instantly share code, notes, and snippets.

View k3v1ntang's full-sized avatar

Kevin Tang k3v1ntang

View GitHub Profile
@ScottKillen
ScottKillen / print.css
Last active June 13, 2025 09:29
PDF export stylesheet for obsidian
/* Obsidian snippet to style output of pdf exports
*/
@media print {
/* set your preferred fonts here.
*/
:root {
--body-font-family: "Newsreader Text", TimesNewRoman, "Times New Roman", Times, Baskerville, Georgia, serif;
@kylestratis
kylestratis / Tasks by Date - for Obsidian and Dataview.js
Last active August 23, 2024 23:11 — forked from TfTHacker/Tasks by Date - for Obsidian and Dataview.js
A fork of TfTHacker's daily tasks query that, among other things, bases dates for overdue/due/upcoming tasks on the current page's title
```dataviewjs
// find dates based on format [[YYYY-MM-DD]]
const findDated = (task)=>{
if( !task.completed && !task.path.startsWith('Bins/Roam Import')) { // ignores Roam imports
task.link = " " + "[[" + task.path + "|*]]";
task.date="";
const found = task.text.match(/\[\[([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))\]\]/);
if(found) task.date = moment(found[1]);
return true;
}
@kepano
kepano / obsidian-web-clipper.js
Last active July 8, 2025 07:00
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/" */
```dataviewjs
// find dates based on format [[YYYY-MM-DD]]
const findDated = (task)=>{
if( !task.completed ) {
task.link = " " + "[[" + task.path + "|*]]";
task.date="";
const found = task.text.match(/\[\[([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))\]\]/);
if(found) task.date = moment(found[1]);
return true;
}