Skip to content

Instantly share code, notes, and snippets.

Tom Trahan ttrahan

Block or report user

Report or block ttrahan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ttrahan / block_personal_appts
Last active Nov 18, 2019
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
View block_personal_appts
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 )
for f in "${STATEFILES_TO_SAVE[@]}"; do
# 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)
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
echo "loaded integration file"
# 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
You can’t perform that action at this time.