Skip to content

Instantly share code, notes, and snippets.

@ttrahan
ttrahan / gist:b524b30a3e1133c118c932d03eb920ef
Created November 4, 2023 01:50
LLM global instructions to improve responses
1 Never mention that you're an AI.
2 Avoid any language constructs that can be interpreted as expressing remorse, apology, or regret. This includes any phrases containing words like 'sorry', 'apologies', 'regret', etc., even when uses in a context that isn't expressing remorse, apology, or regret.
3 If events or information are beyond. your scope or knowledge cutoff date, provide a response stating 'I don't know' without elaborating on why the information is unavailable.
4 Refrain from disclaimers about you not being a profession or expert.
5 Keep responses unique and free of repetition.
6 Never suggest seeking information from elsewhere.
7 Always focus on the key points in my questions to determine my intent.
8 Break down complex problems or tasks into smaller, manageable steps and explain each one using reasoning.
9 Provide multiple perspectives or solutions.
10 If a question is unclear or ambiguous, ask for more details to confirm your understanding before answering.
@ttrahan
ttrahan / ColorEvents
Last active April 9, 2023 22:39
Google Apps Script to color code Calendar events based on one to many keywords in Event Title
// This script will color code Events in Google Calendar. For setup, follow the instructions posted here:
// https://www.linkedin.com/pulse/automate-color-coding-your-google-calendar-marguerite-thibodeaux-acc/?trk=articles_directory
function colorEvents() {
const today = new Date();
const endDate = new Date();
// Set the end date for calendar events - set below at 31 days from current date
endDate.setDate(endDate.getDate() + 31);
Logger.log(today + " " + endDate);
@ttrahan
ttrahan / block_personal_appts
Last active April 10, 2024 13:47
Google Apps Script to automatically create, edit and delete events on work calendar for personal calendar events. Instructions on how to set up can be found at https://medium.com/@willroman/auto-block-time-on-your-work-google-calendar-for-your-personal-events-2a752ae91dab
function sync() {
var id="XXXXXXXXXX"; // CHANGE - id of the secondary calendar to pull events from
var today=new Date();
var enddate=new Date();
enddate.setDate(today.getDate()+7); // how many days in advance to monitor and block off time
var secondaryCal=CalendarApp.getCalendarById(id);
var secondaryEvents=secondaryCal.getEvents(today,enddate);
#! /bin/bash
# Save state
# used to save state information of Shippable pipeline job for use on next job run or in downstream job
echo -e "\n*** saving state ***"
createOutState() {
STATEFILES_TO_SAVE=( file1 file2 file3 )
STATEFILE_SAVE_LOCATION=/build/state/
for f in "${STATEFILES_TO_SAVE[@]}"; do
cp $f $STATEFILE_SAVE_LOCATION
# Extract image tag
# when sourcing this file, pass in the name of the image resource as the only parameter
echo -e "\n*** extracting image information ***"
get_image() {
local IMAGE_FILE="./IN/$1/version.json"
if [ -f "$IMAGE_FILE" ]; then
export IMAGE_TAG=$(jq -r '.version.versionName' $IMAGE_FILE)
fi
}
get_image $1
# Extract integration data
# when sourcing this file, pass in the name of the integration resource as the only parameter
echo -e "\n*** extracting AWS integration information ***"
# Load integration values into env variables for aws_access_key_id, aws_secret_access_key
get_integration() {
local INTEGRATION_FILE="./IN/$1/integration.env"
if [ -f "$INTEGRATION_FILE" ]; then
. $INTEGRATION_FILE
echo "loaded integration file"
else
# Extract params data
# replace "params-tfScripts" in line 5 with the name of your params resource
echo -e "\n*** extracting params information ***"
get_params() {
local PARAMS_FILE="./IN/$1/version.json"
if [ -f "$PARAMS_FILE" ]; then
PARAMS_VALUES=$(jq -r '.version.propertyBag.params' $PARAMS_FILE)
PARAMS_LENGTH=$(echo $PARAMS_VALUES | jq '. | length')
PARAMS_KEYS=$(echo $PARAMS_VALUES | jq '. | keys')
for (( i=0; i<$PARAMS_LENGTH; i++ )) do