A Pen by SMFLSBDIUN on CodePen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==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 |
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" } ) ) ); })()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)}`,
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* 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; } */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(): |
NewerOlder