Compare commits
11 Commits
eced99c49f
...
d4ead0d6a8
Author | SHA1 | Date |
---|---|---|
Trey Blancher | d4ead0d6a8 | |
Trey Blancher | 88510ea15d | |
Trey Blancher | 72ed64bcf6 | |
Trey Blancher | 7f9e01e430 | |
Trey Blancher | 27d88463d2 | |
Trey Blancher | 3a7a4c4007 | |
Trey Blancher | 9959642366 | |
Trey Blancher | b67e7cf990 | |
Trey Blancher | bcfb55a4be | |
Trey Blancher | 787c4c5b2f | |
Trey Blancher | 1fcc3668c5 |
|
@ -13,6 +13,9 @@
|
||||||
2022*
|
2022*
|
||||||
do_process.bak2017-11-06_file-test
|
do_process.bak2017-11-06_file-test
|
||||||
rust/*/target/*
|
rust/*/target/*
|
||||||
|
#vim/syntax/README.md
|
||||||
|
vim/syntax/timetracker.vim.hide
|
||||||
|
vim/syntax/timetracker.vim.tmp
|
||||||
staging
|
staging
|
||||||
test.py
|
test.py
|
||||||
test.sh
|
test.sh
|
||||||
|
|
|
@ -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
|
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 ))
|
MONTH=$(( $(date +%-m) - 1 ))
|
||||||
else
|
else
|
||||||
MONTH=$1
|
MONTH=$1
|
||||||
shift
|
shift
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "x$1" == "x" ]; then
|
if [[ -z "$1" ]]; then
|
||||||
YEAR=$(date +%Y)
|
YEAR=$(date +%Y)
|
||||||
CURR=1
|
CURR=1
|
||||||
else
|
else
|
||||||
|
@ -19,18 +19,18 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ $MONTH -eq 0 ];
|
if [[ "$MONTH" -eq 0 ]];
|
||||||
then
|
then
|
||||||
MONTH=12
|
MONTH=12
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ${CURR} -eq 1 ] && [ $(( $(date +%-m) - $MONTH )) -le 0 ]; then
|
if [[ "${CURR}" -eq 1 ]] && [[ $(( $(date +%-m) - MONTH )) -le 0 ]]; then
|
||||||
YEAR=$(( $YEAR - 1))
|
YEAR=$(( YEAR - 1))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $MONTH -lt 10 ];
|
if [ "$MONTH" -lt 10 ];
|
||||||
then
|
then
|
||||||
MONTH=0$MONTH
|
MONTH=0$MONTH
|
||||||
fi
|
fi
|
||||||
tar -cvJf $YEAR-$MONTH.tar.xz $YEAR-$MONTH-*.log --remove-files
|
tar -cvJf "$YEAR-$MONTH.tar.xz" $YEAR-$MONTH-*.log --remove-files
|
||||||
|
|
||||||
|
|
|
@ -324,7 +324,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "timetracker"
|
name = "timetracker"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"itertools",
|
"itertools",
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
[workspace]
|
[workspace]
|
||||||
|
resolver = "2"
|
||||||
|
|
||||||
members = [
|
members = [
|
||||||
"timetracker",
|
"timetracker",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "timetracker"
|
name = "timetracker"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
|
@ -31,5 +31,6 @@ fn main() {
|
||||||
|
|
||||||
println!();
|
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));
|
||||||
}
|
}
|
||||||
|
|
|
@ -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,}
|
||||||
|
```
|
|
@ -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
|
|
@ -1,8 +1,9 @@
|
||||||
#!/bin/bash
|
#!/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 ))
|
MONTH=$(( $(date +%m) - 1 ))
|
||||||
if [ "x$1" == "x" ]
|
if [[ -z "$1" ]]
|
||||||
then
|
then
|
||||||
YEAR=$(( $(date +%Y) - 1))
|
YEAR=$(( $(date +%Y) - 1))
|
||||||
ONESET=true
|
ONESET=true
|
||||||
|
@ -15,9 +16,9 @@ if [ $MONTH -eq 0 ];
|
||||||
then
|
then
|
||||||
MONTH=12
|
MONTH=12
|
||||||
if [[ ! ${ONESET} ]]; then
|
if [[ ! ${ONESET} ]]; then
|
||||||
YEAR=$(( $YEAR - 1))
|
YEAR=$(( YEAR - 1))
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
tar -cvJf $YEAR.tar $YEAR-*.tar.xz --remove-files
|
tar -cvJf "$YEAR.tar" $YEAR-*.tar.xz --remove-files
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue