Skip to content

Instantly share code, notes, and snippets.

View larkinwc's full-sized avatar
🎯
Focusing

Larkin Williams-Capone larkinwc

🎯
Focusing
View GitHub Profile
@larkinwc
larkinwc / obsidian_to_hugo.sh
Last active September 19, 2024 19:28
Bash script to take a specific obsidian note and copy it along with images into hugo content
#!/bin/bash
set -x # Enable debug mode
# Check if correct number of arguments are provided
if [ "$#" -ne 3 ]; then
echo "Usage: $0 <obsidian_file> <hugo_content_dir> <hugo_post_name>"
exit 1
fi
@larkinwc
larkinwc / concat_md.sh
Created September 10, 2024 22:01
Bash script to copy all .md in the current directory. Useful to have Claude summarize notes from Obsidian
#!/bin/bash
# Create a temporary file
temp_file=$(mktemp)
# Concatenate all non-empty .md files in the current directory, adding titles and separators
for file in *.md; do
if [ -f "$file" ] && [ -s "$file" ] && ! [ -z "$(grep -v '^[[:space:]]*$' "$file")" ]; then
echo -e "\n====== $file ======\n" >> "$temp_file"
cat "$file" >> "$temp_file"
@larkinwc
larkinwc / STF
Created October 21, 2018 16:31 — forked from MiteshShah/STF
#!/bin/bash
# Error handling
function OwnError()
{
echo -e "[ `date` ] $(tput setaf 1)$@$(tput sgr0)"
exit $2
}
# Repository for rethinkdb