HomeAboutPostsTagsProjectsRSS

tool

Updated
Words156
TagsRead1 minute
# Function to download and process subtitles
download_and_process_subtitles() {
    local video_url="$1"
    local base_filename="$2"

    # Download subtitles using yt-dlp
    yt-dlp --write-auto-subs --sub-format "vtt" --skip-download -o "${base_filename}.%(lang)s.%(ext)s" "$video_url"

    # Find the downloaded subtitle file
    local subtitle_file=$(ls ${base_filename}.*.vtt | head -1)

    # Check if the subtitle file exists
    if [ -f "$subtitle_file" ]; then
        # Process the subtitle file to remove tags, timestamps and duplicate lines
        perl -ne 'print unless /<.*>/ or /^\s*$/ or /-->/' "$subtitle_file" | awk '!seen[$0]++' > "${base_filename}.txt"
        echo "Processed subtitle saved as ${base_filename}.txt"
    else
        echo "No subtitle file found."
    fi
}

# Variables
VIDEO_URL="video url"
BASE_FILENAME="basename"

# Call the function
download_and_process_subtitles "$VIDEO_URL" "$BASE_FILENAME"

Updated
Words469
TagsRead2 minutes

Jotting down thoughts helps clarify the mind. The end goal is simple: just write without fretting over tools. That’s why I’ve always found that starting to write with pen and paper is the easiest approach. However, these days, since everyone carries their mobile phone, the trend has shifted towards writing on phones.

At first, I didn’t consider Apple Notes to be a suitable professional note app, so I tried out OneNote, EverNote, and Notion. Unfortunately, none fit my needs. OneNote posed difficulties on mobile devices; its free layout might be handy for stylus use, but on a small screen, it made things hard to identify and search. I gave Notion a shot for half a year, but it was too complex. While it’s great for team collaboration, I didn’t require that functionality, and I was frustrated by the ’everything as a block’ design, which made selecting and formatting a hassle. Notion’s AI is decent, but I wasn’t keen on shelling out another $10 every month on top of ChatGPT Plus. As for Evernote, I mainly used it to collect webpages rather than for writing.

Apple Notes has seen significant enhancements over time. With the introduction of a transformer model in iOS 17, Apple has elevated its autocorrect and predictive text capabilities , understanding and adapting to your typing patterns. It’s even capable of autofilling entire sentences on occasion. My increasing use of Apple Notes on iPhone has led to more frequent use on macOS as well, and the smooth integration across devices enhances the writing experience in a way that other note apps on different platforms can’t match. The autocorrect and inline predictive text feature available on both operating systems is incredibly effective and is arguably unbeatable at the moment.

Apple Notes now features a tag system and smart lists for note management. Combined with other functions like PDF import, file attachment, OCR, and drawing capabilities, Apple Notes meets most of my requirements.

My current workflow involves using Notion for web clipping and Apple Notes for all my personal notes. This approach has taught me to focus less on the tools and more on simply writing. Just write—use the simplest tool at hand and push it to its limits. Only then consider upgrading your tools if necessary.

Updated
Words199
TagsRead1 minute

In Emacs, the fill-paragraph function neatly reflows a block of text, wrapping lines to fit within a specified column width. VS Code offers an extension called “Rewrap,” which you can install to enjoy similar functionality.

  • Selecting the text you want to rewrap and pressing Alt+Q, or
  • Placing your cursor within a comment block and pressing Alt+Q to rewrap that comment.

This feature can increase your productivity significantly if you’re editing or writing a considerable amount of text. It streamlines the process of formatting paragraphs, ensuring that they look neat and are easier to read, very much like Emacs’ fill-paragraph.

Rewrap - Visual Studio Marketplace

Updated
Words156
TagsRead1 minute

This tool Eruda: Console for Mobile Browsers is handy for examining HTML elements on mobile devices without any installation. Simply copy and paste the code below into the address bar, an icon will show up on the screen.

javascript:(function () { var script = document.createElement('script'); script.src="[](https://cdn.jsdelivr.net/npm/eruda";) document.body.append(script); script.onload = function () { eruda.init(); } })();