Compare commits

...

11 Commits

Author SHA1 Message Date
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
9 changed files with 274 additions and 14 deletions

3
.gitignore vendored
View File

@ -13,6 +13,9 @@
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

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));
}

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

@ -0,0 +1,41 @@
# 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.
I haven't figured out a better way to do this in Git, but before I commit it I
will change the following lines in _~/timetracker/.gitignore_ from this:
```
vim/syntax/README.md
vim/syntax/timetracker.vim.hide
vim/syntax/timetracker.vim.tmp
```
To this:
```
#vim/syntax/README.md
vim/syntax/timetracker.vim.hide
vim/syntax/timetracker.vim.tmp
```
And then rename _vim/syntax/timetracker.vim_ to
_vim/syntax/timetracker.vim.tmp_, and rename _vim/syntax/timetracker.vim.hide_
to _vim/syntax/timetracker.vim_:
```
mv vim/syntax/timetracker.vim{,.tmp}
mv vim/syntax/timetracker.vim{.hide,}
```
Commit and push the changes, then revert _.gitignore_ and
_vim/syntax/timetracker.vim_:
```
mv vim/syntax/timetracker.vim{,.hide}
mv vim/syntax/timetracker.vim{.tmp,}
```

213
vim/syntax/timetracker.vim Normal file
View File

@ -0,0 +1,213 @@
" 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
\ 53rd
\ A Cloud Guru
\ AIG
\ Aetna
\ Affinity
\ Alerus
\ Alliant
\ Ally
\ America
\ American
\ Ameriprise
\ AmerisourceBergen
\ Amerisource
\ Anthem
\ Associated
\ Athene
\ BMO
\ Banamex
\ Bandwidth
\ Bank
\ Banks
\ Bergen
\ Block
\ Broadway
\ C
\ CS
\ Canada
\ Canadian
\ Canvas
\ Capital
\ Citi
\ CitiBanamex
\ Citibanamex
\ Citizens
\ Colorado
\ Comerica
\ Community
\ CoPERA
\ Corebridge
\ Credit
\ Desert
\ Digital
\ Dish
\ E
\ ETRADE
\ E*TRADE
\ Empower
\ Equifax
\ Equitable
\ FNBO
\ FNBPA
\ FPCU
\ Fargo
\ Federal
\ Fifth
\ Financial
\ First
\ GTE
\ Gen
\ Hancock
\ Hawaiian
\ Homestreet
\ Huntington
\ Jackson
\ John
\ KeyBank
\ Kohls
\ Life
\ Lock
\ Manulife
\ Mass
\ Montreal
\ Mutual
\ NF
\ NYL
\ National
\ Nationwide
\ Navy
\ Network
\ New
\ Northwestern
\ Norton
\ Of
\ One
\ P
\ PERA
\ PNC
\ Pindrop
\ Plus
\ Prepaid
\ Regions
\ Republic
\ Rowe
\ Royal
\ S3
\ Santander
\ Securian
\ Sentry
\ South
\ State
\ Support
\ TIAA
\ Tire
\ T[.]
\ The
\ Third
\ TRADE
\ TripActions
\ US
\ Union
\ United
\ Walmart
\ Wells
\ West
\ Woodforest
\ WSECU
\ York
\ Zions
\ of
\ the
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_1/libexec/gnubin:/Users/tblancher/homebrew/Cellar/coreutils/9.1/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