<commit_before>#!/bin/bash

## A Vimwiki Journal Reminder:
# Display options to the user via pop-up terminal window
# User will be prompted to decide how to input their entry:
# 1) Open up Vim 
# 2) Abort journal update
# 3) Input entry from terminal window

## Note:
# Make sure to set the setting "Close if the shell exited cleanly"
# in Terminal > Preferences > Shell > When the shell exits.
# Otherwise you might be hitting CTRL-W and ENTER a lot...


## Designate your journal folder location
JOURNALDIR="/Users/organized/Documents/wiki/diary"    

attempts=3 # The number of attempts a user is allowed before process exits

DATE=$(date +"%Y-%m-%d")
CURJOURNAL="$DATE.wiki"
TIME=$(date +"%H:%M")
TEMPDATE="== $TIME =="        # formats timestamp as h2 vimwiki link

## Update the time in the most current journal files
function update_journal_date
{
  ## Check if directory exists
  if [ ! -d $JOURNALDIR ]
    then
      echo "$JOURNALDIR does not exist."
      echo "Check your settings."
      exit 1
  fi

  ## Check for current journal file for day
  if [ -f $JOURNALDIR/$CURJOURNAL ]
    then
      # Append to journal file
      echo "$TEMPDATE" >> "$JOURNALDIR/$CURJOURNAL"
    else
      # Create journal file
      touch $JOURNALDIR/$CURJOURNAL
      echo "Created $JOURNALDIR/$CURJOURNAL"
      echo "$TEMPDATE" > "$JOURNALDIR/$CURJOURNAL"
  fi
}

## Update the journal file with tempentry
function update_journal_entry
{
  echo "Note to self: "
  secs=240

  while [ $secs -gt 0 ] && [ -z "${TEMPENTRY+set}" ]; do
    read -t 1 TEMPENTRY
    : $((secs--)) # subtract one sec from timer
  done

  if [ -z "${TEMPENTRY+set}" ]
    then
      echo "Response not received in time."
    else
      echo "$TEMPENTRY" >> "$JOURNALDIR/$CURJOURNAL"
      echo "Time stamp and journal updated."<commit_msg>add tempdate as an H1 in newest document for indexing<commit_after>#!/bin/bash

## A Vimwiki Journal Reminder:
# Display options to the user via pop-up terminal window
# User will be prompted to decide how to input their entry:
# 1) Open up Vim 
# 2) Abort journal update
# 3) Input entry from terminal window

## Note:
# Make sure to set the setting "Close if the shell exited cleanly"
# in Terminal > Preferences > Shell > When the shell exits.
# Otherwise you might be hitting CTRL-W and ENTER a lot...


## Designate your journal folder location
JOURNALDIR="/Users/organized/Documents/wiki/diary"    

attempts=3 # The number of attempts a user is allowed before process exits

DATE=$(date +"%Y-%m-%d")
CURJOURNAL="$DATE.wiki"
TIME=$(date +"%H:%M")
TEMPDATE="= $DATE ="          # formats date as h1 vimwiki link
TEMPTIME="== $TIME =="        # formats timestamp as h2 vimwiki link

## Update the time in the most current journal files
function update_journal_date
{
  ## Check if directory exists
  if [ ! -d $JOURNALDIR ]
    then
      echo "$JOURNALDIR does not exist."
      echo "Check your settings."
      exit 1
  fi

  ## Check for current journal file for day
  if [ -f $JOURNALDIR/$CURJOURNAL ]
    then
      # Append to journal file
      echo "$TEMPTIME" >> "$JOURNALDIR/$CURJOURNAL"
    else
      # Create journal file
      touch $JOURNALDIR/$CURJOURNAL
      echo "Created $JOURNALDIR/$CURJOURNAL"
      echo "$TEMPDATE" > "$JOURNALDIR/$CURJOURNAL"
      echo "$TEMPTIME" >> "$JOURNALDIR/$CURJOURNAL"
  fi
}

## Update the journal file with tempentry
function update_journal_entry
{
  echo "Note to self: "
  secs=240

  while [ $secs -gt 0 ] && [ -z "${TEMPENTRY+set}" ]; do
    read -t 1 TEMPENTRY
    : $((secs--)) # subtract one sec from timer
  done

  if [ -z "${TEMPENTRY+set}" ]
    then
      echo "Response not received in time."
    else
      echo "$TEMPENTRY" >> "$JOURNALDIR/$CURJOURNAL"
      echo "Time stamp and journal updated."
{'fraction_non_alphanumeric': 0.10867265996827076, 'fraction_numerical': 0.006345848757271285, 'mean_word_length': 3.148026315789474, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '636994', 'n_tokens_mistral': 1220, 'n_tokens_neox': 1219, 'n_words': 447}