Compare commits
34 Commits
Author | SHA1 | Date |
---|---|---|
Trey Blancher | 51779cf88a | |
Trey Blancher | 56a7452e53 | |
Trey Blancher | 2a3ce6caf5 | |
Trey Blancher | b3c033cc0c | |
Trey Blancher | 27bc667432 | |
Trey Blancher | 05b649f529 | |
Trey Blancher | 4e76621d02 | |
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 | |
Trey Blancher | eced99c49f | |
Trey Blancher | dc767ce349 | |
Trey Blancher | d65aac3abb | |
Trey Blancher | 12c608ad2a | |
Trey Blancher | 5808d647b5 | |
Trey Blancher | 62eaa8a39d | |
Trey Blancher | 33f12235df | |
Trey Blancher | fa71b5a918 | |
Trey Blancher | ebd0c1dd3c | |
Trey Blancher | b219a14415 | |
Trey Blancher | c627ea0c3b | |
Trey Blancher | 8f5e179918 | |
Trey Blancher | b4146ba26d | |
Trey Blancher | 55a6247dca | |
Trey Blancher | 0e1e437686 | |
Trey Blancher | 670b577d08 |
|
@ -1,18 +1,24 @@
|
||||||
# Log files, and archives
|
# Log files, and archives
|
||||||
*.xz
|
*log
|
||||||
*.log
|
*.log
|
||||||
*.tar
|
|
||||||
*.pyc
|
*.pyc
|
||||||
*.sw*
|
*.sw*
|
||||||
test.sh
|
*.tar
|
||||||
test.py
|
*.xz
|
||||||
work
|
|
||||||
timetracker.py-pre-incident-fixup
|
|
||||||
do_process.bak2017-11-06_file-test
|
|
||||||
2017*
|
2017*
|
||||||
2018*
|
2018*
|
||||||
2019*
|
2019*
|
||||||
2020*
|
2020*
|
||||||
2021*
|
2021*
|
||||||
staging
|
2022*
|
||||||
|
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
|
||||||
|
test.py
|
||||||
|
test.sh
|
||||||
|
timetracker.py-pre-incident-fixup
|
||||||
|
#toggle_remote.sh
|
||||||
|
work
|
||||||
|
|
|
@ -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));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
klYjp
|
autocmd BufRead,BufNewFile *.log set filetype=timetracker
|
||||||
kly$jp
|
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
klYjp
|
||||||
|
kly$jp
|
|
@ -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
|
|
@ -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.
|
|
@ -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
|
|
@ -1,8 +1,9 @@
|
||||||
#!/bin/bash
|
#!/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 ))
|
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