From b20d1f83a4071af8b2f6c111b56d7a36938724a0 Mon Sep 17 00:00:00 2001 From: tactonbishop Date: Wed, 7 Dec 2022 07:30:05 +0000 Subject: [PATCH] Last Sync: 2022-12-07 07:30:05 --- Electronics/Digital_Circuits/Latches.md | 7 +++++++ scripts/auto_save.sh | 23 +++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 Electronics/Digital_Circuits/Latches.md create mode 100755 scripts/auto_save.sh diff --git a/Electronics/Digital_Circuits/Latches.md b/Electronics/Digital_Circuits/Latches.md new file mode 100644 index 0000000..0567884 --- /dev/null +++ b/Electronics/Digital_Circuits/Latches.md @@ -0,0 +1,7 @@ +--- +categories: + - Computer Architecture + - Electronics + - Hardware +tags: [logic-gates, binary, memory] +--- diff --git a/scripts/auto_save.sh b/scripts/auto_save.sh new file mode 100755 index 0000000..8162ed5 --- /dev/null +++ b/scripts/auto_save.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# This script runs as a cron job in half-hour intervals to automatically commit changes to the remote repository + +NOTES_PATH="${HOME}/repos/computer_science" +SPACE_2_UNDRSCR="${HOME}/repos/bash_scripts/space_to_underscore_filename.sh" + +cd "$NOTES_PATH" + +# Loop through directories and convert spaces in filenames to underscores +source ${SPACE_2_UNDRSCR} +git pull +CHANGES_EXIST="$(git status --porcelain | wc -l)" + +# If no changes, exit. Else commit and push with timestamp +if [ "$CHANGES_EXIST" -eq 0 ]; then + exit 0 +fi + +git pull +git add . +git commit -q -m "Last Sync: $(date +"%Y-%m-%d %H:%M:%S")" +git push -q