Skip to content

Instantly share code, notes, and snippets.

@izimin
izimin / GetHtmlContentByUrl.java
Last active April 18, 2024 19:07
HTML content by URL
private static String getHtmlContentByUrl(String url) {
String content = null;
URLConnection connection;
try {
connection = new URL(url).openConnection();
Scanner scanner = new Scanner(connection.getInputStream());
scanner.useDelimiter("\\Z");
content = scanner.next();
} catch (Exception ex) {
ex.printStackTrace();
@Flashwalker
Flashwalker / obsidian-webclip-as-markdown.user.js
Last active June 4, 2023 04:21
Obsidian web clipper. Send selected content to Obsidian as markdown
// ==UserScript==
// @name Send selected content to Obsidian as markdown
// @version 0.6.8
// @match *://*/*
// @author Flashwalker
// @description Gareth Stretton https://medium.com/@gareth.stretton/obsidian-create-your-own-web-clipper-add83c7662d0 + StackOverflow https://stackoverflow.com/questions/4176923/html-of-selected-text/4177234#4177234
// @updateURL https://gist.github.com/Flashwalker/40f23e01942cc72a47df61bb86821714/raw/obsidian-webclip-as-markdown.user.js
// @downloadURL https://gist.github.com/Flashwalker/40f23e01942cc72a47df61bb86821714/raw/obsidian-webclip-as-markdown.user.js
// @homepage https://gist.github.com/Flashwalker/40f23e01942cc72a47df61bb86821714
// @require https://unpkg.com/turndown/dist/turndown.js
@taktran
taktran / README.md
Last active April 18, 2024 19:08
Extract Chat GPT Logs

Extract Chat GPT Logs

Made this to help me extract Chat GPT logs, for future reference.

Chat GPT did help in helping me write this :)

To use

@Explosion-Scratch
Explosion-Scratch / Bookmarklets.md
Last active January 19, 2026 02:21
Bookmarklets

Copy ChatGPT Transcript as markdown

javascript:void (async () => { let { default: TD } = await import("https://cdn.skypack.dev/turndown");  let json = [   ...document.querySelectorAll(".text-base"), ].map((i) => ({   html: i.innerHTML,   text: i.innerText,   markdown: new TD().turndown(i),   isPrompt: !i.querySelector(".prose"), }));  window.open(   URL.createObjectURL(     new Blob(       [         json           .map((i) =>             i.isPrompt ? `**Prompt**: ${i.text}` : `**ChatGPT**: ${i.markdown}`           )           .join("\n\n"),       ],       { type: "text/plain" }     )   ) ); })()

Google answer

Get a quick answer from google for any question

(async function answer(q) {
  var html = await fetch(
    `https://cors.explosionscratc.repl.co/google.com/search?q=${encodeURI(q)}`,
@alanzchen
alanzchen / DevonThink to Zotero.ipynb
Last active April 30, 2024 23:14
Copying PDFs from DevonThink to their corresponding Zotero items
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andrewmcodes
andrewmcodes / iOS Shortcuts Catalog.md
Created June 11, 2021 21:47 — forked from brucebentley/iOS Shortcuts Catalog.md
This is a public resource designed to help people get started with Siri Shortcuts & the Shortcuts app. It’s made up of the Shortcuts Library, a collection of over 125+ shortcuts grouped into folders, and the Action Directory, a documentation of 125+ of the actions in the Shortcuts app used to build shortcuts.

Bruce's iOS Shortcut Catalog

Hello and welcome to my Shortcuts Catalog!

This is a public resource designed to help people get started with Siri Shortcuts and the Shortcuts app.

It’s made up of the Shortcuts Library, a collection of over 125+ shortcuts grouped into folders, and the Action Directory, a documentation of 125+ of the actions in the Shortcuts app used to build shortcuts.

Enjoy!

@pihentagy
pihentagy / obsidian.css
Created October 9, 2020 09:34
Clutter free edit mode
/* inline formatting, link targets and [[ ]] disappears if not active line*/
div:not(.CodeMirror-activeline) > .CodeMirror-line span.cm-formatting,
div:not(.CodeMirror-activeline) > .CodeMirror-line span.cm-string.cm-url,
div:not(.CodeMirror-activeline) > .CodeMirror-line span.cm-formatting-link,
div:not(.CodeMirror-activeline)>.CodeMirror-line span.cm-hmd-barelink,
div:not(.CodeMirror-activeline)>.CodeMirror-line span.cm-comment
{ display: none; }
/* hide all html tags -- IT IS COMMENTED OUT BY DEFAULT */
/* div:not(.CodeMirror-activeline) > .CodeMirror-line span.cm-tag{ display: none; } */
@mzeryck
mzeryck / mz_invisible_widget.js
Last active March 11, 2026 13:37
A Scriptable script that creates "invisible" widget backgrounds based on your iOS wallpaper, and then either uses them as a Scriptable widget background or exports to your camera roll.
/*
MIT License
Copyright (c) 2024 Maxwell Zeryck
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTW
@brandonko
brandonko / html_to_text_beautifulsoup.py
Last active April 18, 2024 19:46
BeautifulSoup HTML Text Extractor
from bs4 import BeautifulSoup
# Returns the text from a HTML file based on specified tags
def parse_html(html_path):
with open(html_path, 'r') as fr:
html_content = fr.read()
soup = BeautifulSoup(html_content, 'html.parser')
# Check that file is valid HTML
if not soup.find():