Compare commits

...

34 Commits

Author SHA1 Message Date
Trey Blancher 51779cf88a 2024-02-12T17:33:51 -05:00 commit to git.eldon.me 2024-02-12 17:33:33 -05:00
Trey Blancher 56a7452e53 2024-02-12 commit to git.eldon.me 2024-02-12 17:31:56 -05:00
Trey Blancher 2a3ce6caf5 2024-02-12 toggle back to origin 2024-02-12 17:30:24 -05:00
Trey Blancher b3c033cc0c First toggle_remote.sh commit 2023-12-24 03:12:53 -05:00
Trey Blancher 27bc667432 Added toggle_remote.sh for git.eldon.me 2023-12-24 02:53:57 -05:00
Trey Blancher 05b649f529 Revert for Pindrop GitHub 2023-12-24 02:27:10 -05:00
Trey Blancher 4e76621d02 Fixed for public use 2023-12-24 02:18:43 -05:00
Trey Blancher d4ead0d6a8 Fixed timestamp regex 2023-12-24 02:15:01 -05:00
Trey Blancher 88510ea15d For posting to git.eldon.me 2023-12-24 02:14:27 -05:00
Trey Blancher 72ed64bcf6 Initial commit 2023-12-24 02:13:42 -05:00
Trey Blancher 7f9e01e430 Ignoring vim/syntax/timetracker.vim.hide 2023-11-30 17:20:15 -05:00
Trey Blancher 27d88463d2 Rust upkeep, and adding grand total minutes calculation to timetracker 2023-11-30 17:08:37 -05:00
Trey Blancher 3a7a4c4007 Added customer LOB names 2023-11-06 09:13:20 -05:00
Trey Blancher 9959642366 Added quotes around created tarball name 2023-11-06 09:12:20 -05:00
Trey Blancher b67e7cf990 Removed colorization of Standard Ops, now all operations are plain 2023-10-12 15:25:52 -04:00
Trey Blancher bcfb55a4be Fixed PATH, and several conditionals 2023-10-02 16:55:05 -04:00
Trey Blancher 787c4c5b2f Fixed lots of issues when trying to pack previous months 2023-10-02 16:44:26 -04:00
Trey Blancher 1fcc3668c5 Re-added timetracker syntax file, for push to origin 2023-09-29 11:46:51 -04:00
Trey Blancher eced99c49f Moved vim to ~/staging for push to git.eldon.me 2023-09-29 11:44:47 -04:00
Trey Blancher dc767ce349 Various customers added 2023-09-28 22:03:54 -04:00
Trey Blancher d65aac3abb Multipl customers, added NETENG and OPS Jira prefixes 2023-08-25 15:50:30 -04:00
Trey Blancher 12c608ad2a Adding timetracker.vim back to origin 2023-08-02 17:09:35 -04:00
Trey Blancher 5808d647b5 Remove timetracker.vim from git.eldon.me repository, as it contains sensitive data 2023-08-02 17:07:55 -04:00
Trey Blancher 62eaa8a39d Added quite a few customers to timetracker 2023-08-02 16:58:52 -04:00
Trey Blancher 33f12235df Added multiple customer name keywords 2023-06-07 15:48:44 -04:00
Trey Blancher fa71b5a918 Reformatted keyword lists, added several more keywords 2023-05-13 23:52:40 -04:00
Trey Blancher ebd0c1dd3c Updated customer list, added standard ops/tasks 2023-04-27 02:11:48 -04:00
Trey Blancher b219a14415 Working version of timetracker log syntax highlighting 2023-04-11 00:42:46 -04:00
Trey Blancher c627ea0c3b Added another log glob, and ignoring any files from 2022 2023-04-11 00:32:06 -04:00
Trey Blancher 8f5e179918 Initial commit of vim syntax file for timetracker log 2023-04-07 12:39:32 -04:00
Trey Blancher b4146ba26d Initial commit of timetracker/*.log syntax highlighting 2023-04-06 16:57:45 -04:00
Trey Blancher 55a6247dca Renamed timetracker vim macros file 2023-04-06 16:11:36 -04:00
Trey Blancher 0e1e437686 amend! New paths for GNU tar and coreutils
New paths for GNU tar and grep
2023-03-03 17:12:01 -05:00
Trey Blancher 670b577d08 New paths for GNU tar and grep 2023-03-03 17:10:55 -05:00
12 changed files with 159 additions and 24 deletions

22
.gitignore vendored
View File

@ -1,18 +1,24 @@
# Log files, and archives
*.xz
*log
*.log
*.tar
*.pyc
*.sw*
test.sh
test.py
work
timetracker.py-pre-incident-fixup
do_process.bak2017-11-06_file-test
*.tar
*.xz
2017*
2018*
2019*
2020*
2021*
staging
2022*
do_process.bak2017-11-06_file-test
rust/*/target/*
#vim/syntax/README.md
vim/syntax/timetracker.vim.hide
vim/syntax/timetracker.vim.tmp
staging
test.py
test.sh
timetracker.py-pre-incident-fixup
#toggle_remote.sh
work

View File

@ -2,14 +2,14 @@
PATH=/Users/tblancher/homebrew/opt/coreutils/libexec/gnubin:/Users/tblancher/homebrew/opt/gnu-tar/libexec/gnubin:/Users/tblancher/bin:/Users/tblancher/homebrew/bin:/Users/tblancher/homebrew/sbin:/Users/tblancher/gem/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/sbin:/usr/sbin:/Users/tblancher/bin
if [ "x$1" == "x" ]; then
if [[ -z "$1" ]]; then
MONTH=$(( $(date +%-m) - 1 ))
else
MONTH=$1
shift
fi
if [ "x$1" == "x" ]; then
if [[ -z "$1" ]]; then
YEAR=$(date +%Y)
CURR=1
else
@ -19,18 +19,18 @@ else
fi
if [ $MONTH -eq 0 ];
if [[ "$MONTH" -eq 0 ]];
then
MONTH=12
fi
if [ ${CURR} -eq 1 ] && [ $(( $(date +%-m) - $MONTH )) -le 0 ]; then
YEAR=$(( $YEAR - 1))
if [[ "${CURR}" -eq 1 ]] && [[ $(( $(date +%-m) - MONTH )) -le 0 ]]; then
YEAR=$(( YEAR - 1))
fi
if [ $MONTH -lt 10 ];
if [ "$MONTH" -lt 10 ];
then
MONTH=0$MONTH
fi
tar -cvJf $YEAR-$MONTH.tar.xz $YEAR-$MONTH-*.log --remove-files
tar -cvJf "$YEAR-$MONTH.tar.xz" $YEAR-$MONTH-*.log --remove-files

View File

@ -324,7 +324,7 @@ dependencies = [
[[package]]
name = "timetracker"
version = "0.1.0"
version = "0.1.1"
dependencies = [
"chrono",
"itertools",

View File

@ -1,4 +1,5 @@
[workspace]
resolver = "2"
members = [
"timetracker",

View File

@ -1,6 +1,6 @@
[package]
name = "timetracker"
version = "0.1.0"
version = "0.1.1"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -31,5 +31,6 @@ fn main() {
println!();
println!("{}", format!("Grand total: {:.2}", gtoth));
let gtotm: f64 = nearest((gtoth * 60.00) as f64);
println!("{}", format!("Grand total: {:.2}hrs ({:.0} minutes)", gtoth, gtotm));
}

View File

@ -1,2 +1 @@
klYjp
kly$jp
autocmd BufRead,BufNewFile *.log set filetype=timetracker

2
timetracker_macros.vim Normal file
View File

@ -0,0 +1,2 @@
klYjp
kly$jp

20
toggle_remote.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/zsh
readme=$(grep vim/syntax/README.md .gitignore)
if [[ "${readme}" =~ ^# ]]; then # we're switching to Pindrop GitHub
mv vim/syntax/timetracker.vim{,.hide}
mv vim/syntax/timetracker.vim{.tmp,}
/Users/tblancher/homebrew/bin/sed -Ei \
's,^#(vim/syntax/README.md),\1,;s,^#(toggle_remote.sh),\1,' .gitignore
git rm --cached toggle_remote.sh vim/syntax/README.md
git commit -a
git push -u origin primary
else # we're switching to git.eldon.me
mv vim/syntax/timetracker.vim{,.tmp}
mv vim/syntax/timetracker.vim{.hide,}
/Users/tblancher/homebrew/bin/sed -Ei \
's,^(vim/syntax/README.md),#\1,;s,^(toggle_remote.sh),#\1,' .gitignore
git commit -a
git push -u git.eldon.me primary
fi

9
vim/syntax/README.md Normal file
View File

@ -0,0 +1,9 @@
# timetracker.vim syntax file and Git
The _timetracker.vim_ syntax file I use at my employer contains customer names
so it's easy to tell the parts of my timetracker log lines are for particular
customers (or other important entities). Since this information is sensitive,
I am sanitizing it before I post it to my personal, public-facing Git repo on
git.eldon.me.
Just run `./toggle_remote.sh` and it should do the right thing.

View File

@ -0,0 +1,96 @@
" Vim syntaxtax file
" Language: timetracker log
" Creator: Trey Blancher $(base64 -d <<< dGJsYW5jaGVyQHBpbmRyb3AuY29tCg==)
" Latest revision: 2023-04-19
if exists("b:current_syntax")
finish
endif
syntax keyword timetrackerCategories Cloud Call Delivery Internal On Prem PTO transparent contained
syntax keyword timetrackerStartStop Begin End
syntax keyword timetrackerStandardOps
\ API
\ APT
\ AST
\ AVT
\ All
\ Auth
\ Authenticate
\ Behavior
\ Bio
\ Call
\ Certified Kubernetes Administrator
\ Clarizen
\ Correlation
\ Device
\ DRE
\ DSM
\ Express
\ Feedback
\ Grafana
\ Hands
\ Identity
\ Keyboard
\ Maestro
\ PCPN
\ Passport
\ PIN token renewal
\ Prometheus
\ Protect
\ Push
\ Risk
\ Slack
\ Transfer
\ VeriCall
\ Voice
\ Vormetric
\ access
\ behaviorprint
\ daily
\ email
\ handling
\ lesson
\ macOS
\ meeting
\ phoneprint
\ prep
\ scheduled
\ standup
\ timesheets
\ timetracker
\ triage
\ upgrades
\ verification
\ voiceprint
syntax keyword Customers
\ Customer1
\ Customer2
\ Customer3
syntax match timetrackerTimestamp /\d\{4}-\%(0[135789]-\%([0-2]\d\|3[01]\)\|\%(1[02]-\%([0-2]\d\|3[01]\)\)\|0[46]-\%([0-2]\d\|30\)\|11-\%([0-2]\d\|30\)\|02-[0-2]\d\) \%([01]\d\|2[0-3]\):\%([0-5]\d\)\%(:[0-5]\d\)\{2}/ contained
"syntax match ticket /\(#|CM-|PD-\)\d\+/
"syntax match timetrackerTimestampError /^\(\d\{4}-\d\{2}-\d\{2} \d\{2}:\d\{2}:\d\{2}\)\@!/ contained
syntax match timetrackerTask /.*/ contained
"syntax match timetrackerTimestampError /^\(\(\d\{4}-\d\{2}-\d\{2} \d\{2}:\d\{2}:\d\{2}\)\@!\)/ transparent contained
"syntax region errTimestamp matchgroup=timestamp start=/^\(\d\{4}-\(0\d\|1[0-2]\)-\d\{2} \d\{2}:\d\{2}:\d\{2}\)\@!/ end=/: / contains=timetrackerTimestamp
syntax region timestampGroup start=/^/ end=/: / contains=timetrackerTimestamp
syntax region errTimestamp matchgroup=timestamp start="^\%(\d\{4}-\%(\%(0[13578]\|1[02]\)-\%([0-2]\d\|3[01]\)\|\%(0[469]\|11\)-\%([0-2]\d\|30\)\|02-[0-2]\d\) \%([01]\d\|2[0-3]\)\%(:[0-5]\d\)\{2}\)\@!" end=": "
syntax region category start=/\[/ end=/\]/ contains=timetrackerCategories
syntax region ticket start=/\(#\|CM-\|PD-\|NETENG-\|OPS-\)\d\{-1}/ end=/\d /
"syntax region item matchgroup=task start=/\]\s[\k ]\+/ end=/$/ contains=ticket
let b:current_syntaxtax = "timetracker"
highlight default link errTimestamp Error
highlight default link timestamp String
highlight default link timestampGroup String
highlight default link timetrackerStartStop Statement
highlight default link category Type
highlight default link ticket Constant
highlight default link Customers Identifier
"highlight default link timetrackerStandardOps Constant

View File

@ -1,8 +1,9 @@
#!/bin/bash
PATH=/Users/tblancher/homebrew/Cellar/gnu-tar/1.34/libexec/gnubin:/Users/tblancher/homebrew/Cellar/coreutils/9.0/libexec/gnubin:/Users/tblancher/homebrew/bin
PATH=/Users/tblancher/homebrew/opt/coreutils/libexec/gnubin:/Users/tblancher/homebrew/opt/gnu-tar/libexec/gnubin:/Users/tblancher/bin:/Users/tblancher/homebrew/bin:/Users/tblancher/homebrew/sbin:/Users/tblancher/gem/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/sbin:/usr/sbin:/Users/tblancher/bin
MONTH=$(( $(date +%m) - 1 ))
if [ "x$1" == "x" ]
if [[ -z "$1" ]]
then
YEAR=$(( $(date +%Y) - 1))
ONESET=true
@ -15,9 +16,9 @@ if [ $MONTH -eq 0 ];
then
MONTH=12
if [[ ! ${ONESET} ]]; then
YEAR=$(( $YEAR - 1))
YEAR=$(( YEAR - 1))
fi
fi
tar -cvJf $YEAR.tar $YEAR-*.tar.xz --remove-files
tar -cvJf "$YEAR.tar" $YEAR-*.tar.xz --remove-files