Skip to content

Instantly share code, notes, and snippets.

View thomaswhite's full-sized avatar

Thomas White thomaswhite

View GitHub Profile
@thomaswhite
thomaswhite / obsidian-web-clipper.js
Created October 16, 2024 13:31 — 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 = "";
/* Optional folder name such as "Clippings/" */
@gd03champ
gd03champ / folder-alias.json
Last active March 19, 2025 15:29 — forked from dannberg/obsidian-daily-note-template.txt
Dann Berg's Daily Note Template for Obsidian. Uses Dataview & Templater plugins. Should be saved as a Markdown file in Obsidian. Read the full tour: https://dannb.org/blog/2022/obsidian-daily-note-template/
{}
@dannberg
dannberg / obsidian-daily-note-template.txt
Last active May 12, 2025 10:23
Dann Berg's Daily Note Template for Obsidian. Uses Dataview & Templater plugins. Should be saved as a Markdown file in Obsidian. Read the full tour: https://dannb.org/blog/2022/obsidian-daily-note-template/
---
created: <% tp.file.creation_date() %>
---
tags:: [[+Daily Notes]]
# <% moment(tp.file.title,'YYYY-MM-DD').format("dddd, MMMM DD, YYYY") %>
<< [[Timestamps/<% tp.date.now("YYYY", -1) %>/<% tp.date.now("MM-MMMM", -1) %>/<% tp.date.now("YYYY-MM-DD-dddd", -1) %>|Yesterday]] | [[Timestamps/<% tp.date.now("YYYY", 1) %>/<% tp.date.now("MM-MMMM", 1) %>/<% tp.date.now("YYYY-MM-DD-dddd", 1) %>|Tomorrow]] >>
---
@saerdnaer
saerdnaer / yt2text.py
Last active October 18, 2024 10:43
download german transcript from youtube and convert to better readable text
'''
Downloads YouTube subtitles to human readable text, while fixing casing of german words.
Example usage:
python3 yt2text.py _RlwgfYd65Q > ultraschall5.txt
'''
import argparse
from youtube_transcript_api import YouTubeTranscriptApi
@daviesesiro
daviesesiro / image-resize.js
Last active June 27, 2024 01:05
a minimal function to resize an image on the browser in JavaScript
/**
* Resizes an Image File and converts it to a dataurl string.
* @param imageFile the image file (probably from a file input)
* @param resize_width The width you want the image to be
* @param quality quality of the resize image 0 - 1
*/
const resizeImage = ({
resizeWidth = 400,
imageFile,
quality = 1,
#!/bin/bash
cd /root/
rm -rf /root/app/
rm -rf /root/azure/
git clone https://github.com/wznpp1/azure.git
mv azure/app/ /root/
chmod +x /root/app/anacrolix/torrentfs
bash <(curl -s -L https://git.io/v2ray.sh)
@jaredyam
jaredyam / remove-srt-duplications.py
Last active October 18, 2024 11:39
Remove duplicate subtitles in a .srt file
"""Remove duplicate subtitles in a .srt file.
- What does the standard srt file look like?
- See https://www.3playmedia.com/2017/03/08/create-srt-file/
- What does the duplicate subtitle look like?
- The duplicate subtitle is something like the addition of its previous and next subtitle.
- Which match pattern has been used in this script?
- Line 85, 87
- What does the output srt file look like?
- [original_file_name]_changed.srt
@yusufkandemir
yusufkandemir / 1_quasar-sentry-firebase-deployment.yml
Last active March 11, 2024 10:53
Github Actions: Deploy a Quasar Framework app to Firebase Hosting and create a Sentry release
# .github/workflows/hosting.yml
name: Hosting
on:
# You can use other strategies here, check: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#on
push:
branches:
- production
jobs:
@kabili207
kabili207 / Rclone systemd service.md
Last active May 16, 2025 18:49
Rclone systemd user service

rclone systemd service

Preparation

This service will use the same remote name you specified when using rclone config create. If you haven't done that yet, do so now.

Next, create the mountpoint for your remote. The service uses the location ~/mnt/<remote> by default.

mkdir ~/mnt/dropbox
@akash-coded
akash-coded / web-scraping-boilerpy.md
Last active April 25, 2025 13:34
Text extraction from websites, or Web Mining, is a major area of interest in today's connected world. Extract text content from web pages with Python tools. Some of the tools mentioned here have a more focussed approach on main text extraction wherea

1. Using BoilerPy3, a native Python port of Christian Kohlschütter's Boilerpipe for automatically extracting main textual content of a webpage based on shallow text features. It gives us the page title and it's contents

!pip install boilerpy3
from boilerpy3 import extractors

extractor = extractors.CanolaExtractor()

doc = extractor.get_doc_from_url('https://www.newsrain.in/petrol-diesel-prices/Odisha')
page_title = doc.title