Below you will find pages that utilize the taxonomy term “chatgpt”
Posts
Simple GPT CLI
Using my friend ChatGPT I made a little CLI to talk to… GPT. It’s basically a bash script that you can place in one of you bin folders and execute from wherever in your terminal:
gpt "I need a new cactus, what is a nice type that needs little maintenance?" After which GPT will answer you with (hopefully) a nice answer:
GPT-3 answers: One type of cactus that is low-maintenance is the Peruvian apple cactus.
Posts
A ChatGPT prompt generation script to summarize & review the code changes between two branches
summareview.sh #!/bin/bash # This script will help you to generate a ChatGPT prompt that you can use to summarize and review the changes between two branches. # It will prompt you for the feature branch, the branch to compare to, the ticket/story/bug description, and any additional feedback. # It will then output the changes and the prompt to a file called summareview.txt. # Get the current branch current_branch=$(git rev-parse --abbrev-ref HEAD) # Prompt for feature branch (default: current branch) read -p "Enter the feature branch to compare (default: $current_branch): " feature_branch feature_branch=${feature_branch:-$current_branch} # Prompt for branch to compare to (default: develop) read -p "Enter the branch to compare to (default: develop): " compare_branch compare_branch=${compare_branch:-develop} # Prompt for ticket/story/bug description read -p "Enter the ticket/story/bug description: " ticket_description # Prompt for additional feedback read -p "Enter any additional feedback (optional): " additional_feedback # Execute git log command and store the output in a variable git_log_output=$(git log $compare_branch.
Posts
Highlight search terms in Wordpress
To highlight search terms in the content in your Wordpress search result page, add the following function to your functions.php file:
function search_excerpt_highlight() { $content = get_the_content(); $content = wp_strip_all_tags($content); // Set the excerpt length $excerpt_length = 100; // You can adjust this value to your desired excerpt length $padding = 10; // Add padding around the search term $keys = explode(' ', get_search_query()); $first_key = $keys[0]; // Find the first occurrence of the search term $term_pos = stripos($content, $first_key); if ($term_pos !