Skip to content

Add missing final newlines #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion airtable-to-network/airtable-to-network.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,4 @@ def process_csv(input_path):
print(f"Error: File not found: {input_csv_path}")
sys.exit(1)

process_csv(input_csv_path)
process_csv(input_csv_path)
2 changes: 1 addition & 1 deletion clean-transcript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ source ~/.zshrc
SCRIPT_DIR="${0:a:h}"

# Run the Bun/TypeScript cleaner
bun "$SCRIPT_DIR/audio-transcriber/clean-transcript.ts" "$@"
bun "$SCRIPT_DIR/audio-transcriber/clean-transcript.ts" "$@"
5 changes: 5 additions & 0 deletions clipboard-to-markdown/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
# clipboard-to-markdown

Converts HTML in your clipboard into Markdown. The script now checks if the
clipboard actually contains `text/html` data using macOS clipboard commands.
If no HTML is detected, the plain text from the clipboard is converted instead
and a message is shown.
41 changes: 37 additions & 4 deletions clipboard-to-markdown/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,52 @@

import clipboard from "clipboardy";
import TurndownService from "turndown";
import { execSync } from "child_process";

// Create an instance of the Turndown service
const turndownService = new TurndownService();

function hasHtmlInClipboard(): boolean {
try {
const info = execSync("osascript -e 'clipboard info'", { encoding: "utf8" });
if (info.toLowerCase().includes("html")) {
return true;
}
} catch {
// ignore and fall back to pbpaste
}
try {
const html = execSync("pbpaste -Prefer html", { encoding: "utf8" }).trim();
return html.length > 0;
} catch {
return false;
}
}

async function convertClipboardHtmlToMarkdown(): Promise<string | null> {
try {
// Read text from clipboard
const clipboardContent: string = await clipboard.read();
let clipboardContent: string | null = null;

if (hasHtmlInClipboard()) {
try {
clipboardContent = execSync("pbpaste -Prefer html", {
encoding: "utf8",
});
} catch {
clipboardContent = await clipboard.read();
}
} else {
console.log("No HTML content found in clipboard. Converting plain text.");
clipboardContent = await clipboard.read();
}

if (!clipboardContent || clipboardContent.trim() === "") {
console.log("Clipboard is empty. Nothing to convert.");
return null;
}

// Convert HTML to Markdown
const markdown: string = turndownService.turndown(clipboardContent);

// Output the Markdown content or copy it back to the clipboard
console.log(markdown);
await clipboard.write(markdown);

Expand Down
1 change: 1 addition & 0 deletions crawler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

# Optional parameters:
# @raycast.icon 🕷️
# @raycast.argument1 { "type": "text", "placeholder": "Starting URL" }

# Documentation:
# @raycast.description Web crawler utility using crawl4ai
Expand Down
23 changes: 19 additions & 4 deletions crawler/crawler.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
import os
import json
from urllib.parse import urljoin
import argparse
from crawl4ai import WebCrawler
from crawl4ai.extraction_strategy import LLMExtractionStrategy, NoExtractionStrategy

# Add flags to control link following and extraction strategy
FOLLOW_INTERNAL_LINKS = True
USE_EXTRACTION_STRATEGY = False
parser = argparse.ArgumentParser(description="crawl a page using crawl4ai")
parser.add_argument("url", help="starting URL to crawl")
parser.add_argument(
"--follow-internal",
action="store_true",
help="follow internal links from the starting page",
)
parser.add_argument(
"--extract",
action="store_true",
help="use the LLM extraction strategy",
)

args = parser.parse_args()

FOLLOW_INTERNAL_LINKS = args.follow_internal
USE_EXTRACTION_STRATEGY = args.extract

def create_crawler():
crawler = WebCrawler(verbose=True)
Expand All @@ -15,7 +30,7 @@ def create_crawler():

crawler = create_crawler()

url = "https://download4.epson.biz/sec_pubs/pos/reference_en/escpos/tmt88vi.html"
url = args.url

def process_and_save_content(url, content):
filename = f"output/{url.replace('https://', '').replace('/', '_')}.md"
Expand Down
2 changes: 1 addition & 1 deletion extract-tweet-media/extract-tweet-media.sh
Original file line number Diff line number Diff line change
Expand Up @@ -284,4 +284,4 @@ else
cd ..
rmdir "$FOLDER_NAME" 2>/dev/null || true
fi
fi
fi
10 changes: 9 additions & 1 deletion finder-to-ghostty/finder-to-ghostty.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
#!/bin/bash

open -a Ghostty "$FINDER_PATH"
if [ -z "$FINDER_PATH" ]; then
echo "Error: FINDER_PATH environment variable is not set." >&2
exit 1
fi

if ! open -a Ghostty "$FINDER_PATH"; then
echo "Failed to open Ghostty. Ensure Ghostty is installed and accessible." >&2
exit 1
fi
2 changes: 1 addition & 1 deletion read-later-to-html/read-later-to-html.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ def convert_json_to_html(json_file):
print(f"HTML file created: {output_file}")
except Exception as e:
print(f"Error: {str(e)}")
sys.exit(1)
sys.exit(1)
2 changes: 1 addition & 1 deletion summarize-transcript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ source ~/.zshrc
SCRIPT_DIR="${0:a:h}"

# Run the Bun/TypeScript summarizer
bun "$SCRIPT_DIR/audio-transcriber/summarize-only.ts" "$@"
bun "$SCRIPT_DIR/audio-transcriber/summarize-only.ts" "$@"
2 changes: 1 addition & 1 deletion transcribe-audio-only.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ source ~/.zshrc
SCRIPT_DIR="${0:a:h}"

# Run the Bun/TypeScript transcriber
bun "$SCRIPT_DIR/audio-transcriber/transcribe-only.ts" "$@"
bun "$SCRIPT_DIR/audio-transcriber/transcribe-only.ts" "$@"