Readd autoslot, update .bashrc, .vimrc, .zshrc

This commit is contained in:
Timo Schmidt 2023-06-29 18:32:27 +02:00
parent 7a5c14c3c5
commit edeca4bf05
4 changed files with 72 additions and 13 deletions

35
.bashrc
View File

@ -1,4 +1,10 @@
alias bsq='cd ~/repos/piscine/bsq && zellij'
if [ -f ~/.bash_aliases ] || :; then
. ~/.bash_aliases
fi
alias killrev="2>/dev/null kill -9 \$(ps auxww|grep '[_]_import__('|awk '{print $2}')"
alias l='ls -lArthF --color=auto'
alias v='vim'
alias ..='cd ..'
@ -17,6 +23,16 @@ alias norm='alacritty -e sh -c '\''git rev-parse --show-toplevel || { echo "Exit
alias AH='cd /nfs/homes/tischmid/repos/42cursus/libft'
alias z='\zellij options --disable-mouse-mode'
alias zellij='\zellij options --disable-mouse-mode'
alias pacop='clear && 2>/dev/null paco && 2>/dev/null paco --strict'
# echo "hackerman? come to bocal :)"
# curl parrot.live
xset r rate 200 60
export TERM=xterm
HISTSIZE=-1
HISTFILESIZE=-1
__ftest_file () {
file="${1}"
@ -65,13 +81,14 @@ dapt () {
docker rmi $(docker images -f "dangling=true" -q) 2>/dev/null
}
norminette () {
version="$($(type -P norminette) -v | cut -d" " -f2)"
if [ ! "${version}" = "3.3.50" ]; then
printf "%s\n" "Your norminette version is not 3.3.50, but ${version}, which will not catch some indentation errors. Please up-/downgrade"
fi
$(type -P norminette) -R CheckForbiddenSourceHeader "$@"
}
# norminette () {
# version="$($(type -P norminette) -v | cut -d" " -f2)"
# if [ ! "${version}" = "3.3.50" ]; then
# printf "%s\n" "Your norminette version is not 3.3.50, but ${version}, which will not catch some indentation errors. Please up-/downgrade"
# fi
# $(type -P norminette) -R CheckForbiddenSourceHeader "$@"
# }
jmp () {
cd "$(find . -name "${1}" -not -wholename "*mouli*" -print -quit)"
if [ "${?}" = "0" ] ; then
@ -79,16 +96,16 @@ jmp () {
fi
}
xset r rate 200 60
PATH="${PATH}:~/.local/bin"
GIT_PROMPT="1"
GIT_PROMPT="0"
if [ ! -f ~/git-prompt.sh ] && [ "${GIT_PROMPT}" = "1" ] ; then
curl --silent --location 'https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh' -o ~/git-prompt.sh
fi
__norm () {
return 1;
[ -z "${PWD##*ft*}" ] || { return 1; }
norminette 1>/dev/null 2>&1 && printf ' \033[92m%s\033[m' "[Norm: OK]" || printf ' \033[101;37m%s\033[m' "[䝝誒 ‼ NORM ‼ 屌誒]"
return 0

5
.vimrc
View File

@ -4,7 +4,7 @@ syntax enable
set tabstop=4
set background=dark
colorscheme PaperColor
colorscheme dichromatic
set shiftwidth=4
set autoindent
set smartindent
@ -82,6 +82,3 @@ let @w='gg^/START cc/* ////Go*/ ////<C-o>'
let @q='gg^/\/\/\/\/ cc#define STARTndd<C-o>'
let @c='G:Stdheader o #define START #include <stdio.h> int main(void) { }O return (0);k'
let g:user42 = 'tischmid'
let g:mail42 = 'tischmid@student.42berlin.de'

5
.zshrc
View File

@ -1 +1,6 @@
exec bash
if [ -f ~/.bash_aliases ] || :; then
. ~/.bash_aliases
fi
export PATH=$HOME/.brew/bin:$PATH

40
autoslot.sh Executable file
View File

@ -0,0 +1,40 @@
#!/bin/sh
ITERS=1000
HEAD=20
DELAY=2
for i in $(seq ${ITERS}); do
clear
printf '\033[36m%s\033[m\n' "AUTOSLOT: Query available slots periodically."
printf '\033[33m%s\033[m\n' "Iter: ${i} / ${ITERS}"
printf '\033[32m%s\033[m\n' "$(date)"
printf '\033[34m%s\033[m\n' "Next ${HEAD} Slots Open At:"
ls |
curl 'https://projects.intra.42.fr/projects/42cursus-libft/slots.json?team_id=4845701&start=2023-06-26&end=2023-07-03' \
-H 'authority: projects.intra.42.fr' \
-H 'accept: application/json, text/javascript, */*; q=0.01' \
-H 'accept-language: en-US,en;q=0.6' \
-H 'cookie: _intra_42_session_production=a5af775175d1d00d63ae5629a83ce8af; user.id=MTQ3ODQ1--2ed4a01852220e3253f40a3457511a8ae91ca457' \
-H 'if-none-match: W/"c50d54b4d898987a69c2b810f9101eba"' \
-H 'referer: https://projects.intra.42.fr/projects/42cursus-libft/slots?team_id=4906806' \
-H 'sec-ch-ua: "Chromium";v="112", "Brave";v="112", "Not:A-Brand";v="99"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "Linux"' \
-H 'sec-fetch-dest: empty' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-site: same-origin' \
-H 'sec-gpc: 1' \
-H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36' \
-H 'x-csrf-token: IlY7ykOOgpk42mn8uI1Nlmf7VOqeIBHUdIiEke5Eqg0/qYfdwDbB4yLPAAm1C9kKrqhgM5lAbmk4xYbpXkX9sQ==' \
-H 'x-requested-with: XMLHttpRequest' \
--compressed \
-s |
jq '.[].start' -r |
tr 'T' ' ' |
sed 's/\.000+0[[:digit:]]:00//g' |
sort -n |
head -n${HEAD}
printf '\033[35m%s\033[m\n' "<EOF>"
sleep ${DELAY}
done