aoc template
This commit is contained in:
parent
3411e0e459
commit
518d6157b5
31
.bashrc
31
.bashrc
|
|
@ -95,7 +95,7 @@ alias aptclean='sudo apt -y update && sudo apt -y full-upgrade &&
|
|||
alias pacman='pacman --color=auto'
|
||||
alias pcker='nvim "${HOME-}"/.config/nvim/lua/*'
|
||||
alias after='nvim "${HOME-}"/.config/nvim/after/plugin'
|
||||
alias l='\ls --width="${COLUMNS:-80}" --sort=time --time=mtime --color=auto --time-style=long-iso -bharZ1l'
|
||||
alias l='\ls --width="${COLUMNS:-80}" --sort=time --time=mtime --time-style=long-iso -bharZ1l'
|
||||
# alias l='lsd --timesort --color=auto -harZ1l'
|
||||
alias ll='\ls --width="${COLUMNS:-80}" --sort=time --time=mtime --color=auto --fu -bharZ1l'
|
||||
alias ls='\ls --width="${COLUMNS:-80}" --color=auto -bC'
|
||||
|
|
@ -174,8 +174,11 @@ function paruuu () {
|
|||
&& [ ! "${ssid-}" = "Silmaril 4 (2.4)" ] \
|
||||
&& [ -n "${ssid-}" ] \
|
||||
&& : ; then
|
||||
printf '\033[31m%s\033m\n' "You're connected to '${ssid-}', not updating?"
|
||||
else
|
||||
read -p "[31mYou're connected to '${ssid-}', update anyway (Y|n)?[m" choice
|
||||
if [ ! "${choice}" = "y" -a ! "${choice}" = "Y" -a -n "${choice}" ]; then
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
# shellcheck disable=SC2033
|
||||
time (
|
||||
printf '\033[30;41m%s\033[m\n' 'Cache credentials for sudo:' \
|
||||
|
|
@ -199,12 +202,14 @@ function paruuu () {
|
|||
&& printf '\n\033[30;42m%s\033[m\n' '###### Done without error ######' \
|
||||
|| printf '\n\033[30;41m%s\033[m\n' '###### Some error occured! ######'
|
||||
)
|
||||
fi
|
||||
}
|
||||
|
||||
function skill () {
|
||||
if [ -n "${1-}" ] ; then
|
||||
# shellcheck disable=SC2046,SC2009
|
||||
2>/dev/null kill -9 \
|
||||
-- $(ps auxww | grep "${1-}" | grep -v grep | awk '{print $2}') \
|
||||
&& return 0
|
||||
2>/dev/null sudo kill -9 \
|
||||
-- $(ps auxww | grep "${1-}" | grep -v grep | awk '{print $2}')
|
||||
else
|
||||
|
|
@ -491,15 +496,27 @@ aocload () {
|
|||
|
||||
import re
|
||||
import sys
|
||||
from functools import lru_cache
|
||||
from collections import deque, defaultdict
|
||||
import math
|
||||
import numpy as np
|
||||
from functools import cache, lru_cache, reduce
|
||||
from itertools import (
|
||||
repeat, cycle, combinations, combinations_with_replacement,
|
||||
permutations, tee, pairwise, zip_longest, islice, takewhile,
|
||||
filterfalse, starmap
|
||||
)
|
||||
from collections import deque, defaultdict, Counter
|
||||
e=enumerate
|
||||
def pairs(iterable, filler=None):
|
||||
a, b = tee(iterable)
|
||||
next(b, None)
|
||||
return islice(zip(a, b), None, None, 2))
|
||||
|
||||
|
||||
data = open(0).read().strip()
|
||||
lines = data.splitlines()
|
||||
|
||||
for line in lines:
|
||||
line = line
|
||||
line = line.split()
|
||||
TEMPLATE
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue