nofap-tracker/nojack-tracker final


SUBMITTED BY: Guest

DATE: June 21, 2024, 5:17 p.m.

FORMAT: Text only

SIZE: 2.2 kB

HITS: 283

  1. # requires dateutils (https://www.fresse.org/dateutils/). 'unset -v LDFLAGS CXXFLAGS CFLAGS CPPFLAGS' required for compilation due to include folders and -Qunused-arguments
  2. # inefficient, ugly, slow mess
  3. nojack-tracker() {
  4. ddifffmat() { date -u -d @$(date "+%s" -d "$@") +"%Y-%m-%dT%H:%M:%S" ; }
  5. njhll() { if [ -a ~/nojack-history ] ; then tail -n 1 ~/nojack-history | tr -d '\n' ; fi ; }
  6. suffixeddate() { echo "$(< ~/nojack-date)" | xargs bash -c 'echo "${@:1:2}" "$3""$(case $3 in 1|21|31) echo "st";; 2|22) echo "nd";; 3|23) echo "rd";; *) echo "th";; esac)", "$4" @ "${@:5}"' argv0 ; }
  7. nojackdiff() { datediff "$(ddifffmat "$(< ~/nojack-date)")" "$(if [ "$1" == "now" ]; then echo -n "$1" ; else ddifffmat "$@" ; fi)" -f '%d %H %M' | xargs bash -c 'echo -n "${1#-} $(if [ "$1" -eq "1" ]; then echo -n "day" ; else echo -n "days" ; fi), $2 $(if [ "$2" -eq "1" ]; then echo -n "hour" ; else echo -n "hours" ; fi), $3 $(if [ "$3" -eq "1" ]; then echo -n "minute" ; else echo -n "minutes" ; fi)"' argv0 ; }
  8. if [ -z "$1" ]; then
  9. echo "Last served Satan, the NWO, perversion, degeneracy, sexual deviance, and dumb, repulsive, revolting, disgusting, filthy, evil cunt whores that are disgusted by you, that mock you, that hate you, that revel in the power they wield over you:"
  10. echo -n "$(nojackdiff now) ago"
  11. echo " ($(suffixeddate))" ;
  12. elif [ "$1" == "-set" ] && [ $# -gt 1 ]; then
  13. date +"%A, %B %e %Y %l:%M %P %Z" -d "$(echo "${@:2}")" | tr -d '\n' >~/nojack-date
  14. if [ -n "$(njhll)" ] ; then echo "(run lasted $(nojackdiff "$(njhll | cut -d' ' -f1-7)"))" | xargs bash -c 'echo "$(< ~/nojack-date)" "$@"' argv0 >> ~/nojack-history ; else echo "$(< ~/nojack-date)" >> ~/nojack-history ; fi
  15. chflags hidden ~/nojack-history ~/nojack-date
  16. echo "Date set to: $(suffixeddate) ($(nojackdiff now) ago)" ;
  17. elif [ "$1" == "-hist" ] && [ $# -eq 1 ]; then
  18. cat ~/nojack-history ;
  19. else
  20. echo $'Usage: nojack-tracker\n nojack-tracker -set [date]\n nojack-tracker -hist'
  21. fi
  22. unset -f ddifffmat njhll suffixeddate nojackdiff
  23. }

comments powered by Disqus