Skip to content

Instantly share code, notes, and snippets.

View jasondavis's full-sized avatar

Jason Davis jasondavis

View GitHub Profile
@daeh
daeh / default-template.md
Last active May 6, 2022 04:30
obsidian-default-template
created assets tags
<% tp.date.now('YYYY-MM-DD') %>T<% tp.date.now('HH-mm') %>
<% tp.file.path(false).split('/').slice(0, -1).join('/') + '/_resources/' + tp.file.title + '.assets/' %>

<% tp.file.title %>

assets

@jasondavis
jasondavis / 1-2-4-Column-Grid-Photo-Album-Template.html
Created October 17, 2021 22:17
HTML 1, 2, and 4 column photo grid Template and demo from Source: https://www.w3schools.com/howto/howto_js_image_grid.asp
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
* {
 box-sizing: border-box;
}
body {
@kepano
kepano / obsidian-web-clipper.js
Last active May 2, 2024 13:07
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/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@jasondavis
jasondavis / bookmarklet-generator.html
Created August 5, 2021 12:20
Bookmarklet Generator
<!DOCTYPE html>
<index>
<head>
<title>Bookmarklet Maker</title>
<meta name="keywords" content="bookmarklet, hack, javascript, automate, browse, app">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="Bookmarklet creator tool.">
<meta name="author" content="Caio Rodrigues.">
<style>
/* body {background-color: powderblue;} */
@Skhmt
Skhmt / downloadbookmarklet.js
Last active April 29, 2024 21:17
Bookmarklet to download all images of a given class
javascript: (function () {
document.querySelectorAll('.BRpageimage').forEach(i => {
const url = new URL(i.src);
const filename = url.searchParams.get('file').split('/').pop().replace('.jp2','.jpg');
url.searchParams.set('scale', 1);
dl(url.href, filename);
});
function dl(url, filename) {
function blob2B64(blob, callback) {
@ttscoff
ttscoff / pins-bookmarklet.js
Created June 29, 2021 13:04
Bookmarklet for Pins.app (1.6+)
// Bookmarklet for [Pins.app](https://get-pins.app/) (requires version 1.6+)
// Removes Google Analytics strings
// Removes Product Hunt query string
// Prefers canonical url if defined
// Uses selected text for description, falling back to meta description
// Removes pipes (|) from title
// To allow use on any website in Firefox, go to about:config and set security.external_protocol_requires_permission to false
// Copy this to your URL bar:
javascript:!function(){function e(e){var n="pins://launch?screen=newPost&",i=o();""===i&&(i=r()),n+="url="+encodeURIComponent(e),n+="&",n+="title="+encodeURIComponent(t()),n+="&",n+="description="+encodeURIComponent(i),document.location.href=n}function t(){var e=document.title;return e.replace(/\|/g,"-")}function n(){for(var e=document.getElementsByTagName("link"),t=0;t<e.length;t++)if(e[t].attributes.hasOwnProperty("rel")&&"canonical"===e[t].attributes.rel.textContent.toLowerCase())return e[t].attributes.href.textContent;var n,o=document.location.href.split(/[?&]([^&]+)/
@daeh
daeh / asset-helper.py
Last active September 25, 2023 19:04
Obsidian Templater Helper to Insert Clipboard Contents into MD Notes
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Obsidian Templater Helper to Insert Clipboard Contents into MD Notes
Use Templater to control how Obsidian processes images pasted into notes.
N.B. Its functionality would be better as a plugin. This solution is fairly hacky.
Only tested on MacOS with Python 3.8.
Image in clipboard is saved to:
#SingleInstance Force
ShowNotification(title, text)
{
notif_option := 0x24 | 32
TrayTip(text, title, notif_option)
}
SetMuteAll(state, check)
{
@idelem
idelem / titleUrlMarkdownClip.js
Last active March 12, 2024 02:01 — forked from bradleybossard/titleUrlMarkdownClip.js
Bookmarklet to copy current page title and url in Markdown format to clipboard, like [title](url) - Usual for posting links to resources in README.md files
javascript:(function() {
function copyToClipboard(text) {
if (window.clipboardData && window.clipboardData.setData) {
/*IE specific code path to prevent textarea being shown while dialog is visible.*/
return clipboardData.setData("Text", text);
} else if (document.queryCommandSupported && document.queryCommandSupported("copy")) {
var textarea = document.createElement("textarea");
textarea.textContent = text;