Skip to content

Instantly share code, notes, and snippets.

View evanharmon1's full-sized avatar
🎧
Focusing

Evan Harmon evanharmon1

🎧
Focusing
View GitHub Profile
@evanharmon1
evanharmon1 / obsidian-web-clipper.js
Last active October 19, 2023 15:19 — forked from kepano/obsidian-web-clipper.js
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 = "Memex";
/* Optional folder name such as "Clippings/" */
@evanharmon1
evanharmon1 / README.md
Created December 27, 2022 17:03 — forked from arikfr/README.md
Redash Query Export Tool

Setup

$ pip install click requests

Usage

$ python query_export.py --redash-url "https://app.redash.io/" --api-key ""
@evanharmon1
evanharmon1 / outputCloudFormationResources.py
Last active October 27, 2021 14:58
Script to parse a CloudFormation yaml file and output a text file that lists all of its resources.
# Script to parse a CloudFormation yaml file and output a text file that lists all of its resources.
# For purposes of architecture and dependency analysis. Will list type as well as Condition or DependsOn fields if they exist.
# Example: python3 outputCloudFormationResources.py cloudFormation.yaml
# Will output a file named resources-cloudFormation.yaml
# Output for each resource:
# Name: MyEC2Instance3
# Type: AWS::EC2::Instance3
# Condition: aCondition2
# DependsOn: MyEC2Instance2
@evanharmon1
evanharmon1 / opml2mmdCustom.sh
Last active August 6, 2022 18:21
opml2mmd for omnioutliner documents, adapted from scottslowe
// Adapted from https://github.com/scottslowe script - https://github.com/scottslowe/scripts/blob/main/opml2mmd
#!/usr/bin/env bash
# Assign help text to variable for user later
HELP="Usage: opml2mmd [SOURCE] [DEST]"
NUMPARAMS="Error: Incorrect number of parameters"
# If the user supplied no parameters, then provide help text
if [ "$#" -eq 0 ]; then
@evanharmon1
evanharmon1 / appendToObsidianNote.js
Last active August 6, 2022 18:22
Drafts App Action to append drafts note to today's Daily Note in Obsidian
// For an append to daily note in Obsidian Drafts app action
// Build CSV list of Drafts tags, spaces in tags changed to '_'
let tags = draft.tags;
let noteTags = "";
for (let i = 0; i < tags.length; i++) {
let nstag = tags[i].replaceAll( ' ', '_');
noteTags += " #" + nstag + ",";
}
@evanharmon1
evanharmon1 / markdownBlockQuoteClip.js
Last active October 14, 2021 01:47 — forked from idelem/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() {
/* My modified version to only copy the selection as markdown block quotes */
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");
@evanharmon1
evanharmon1 / SendToObsidianWithYAML.js
Last active November 15, 2022 05:35
My Drafts app share extension for adding a note to Obsidian.md adapted to sanitize URLs from CuriousRabbit's original at https://actions.getdrafts.com/a/1p2
/*
Ver 0.9.0 Send Draft.app draft to Obsidian with YAML front matter. 2021-08-08
Ver 0.9.1 Correct a copy/paste error causing runtime exception. 2021-08-09
Ver 0.9.2 Switch YAML date to draft creation date. Clarify comments 2021-08-12
Ver 1.0.0 Restructure to turn all YAML, except the tags, user configurable
text. Makes configuration of custom YAML possible. 2021-08-18
Ver 1.0.1 Add "inbox" folder option and createSilently option. 2021-08-21
From a direction pointed to in Ulysses sheet w/ tags action.
Thanks to Olivier Spinnler (@OlivierPS) and others.