:echo @% def/my.txt directory/name of file (relative to the current working directory of /abc)
:echo expand('%:t') my.txt name of file ('tail')
:echo expand('%:p') /abc/def/my.txt full path
:echo expand('%:p:h') /abc/def directory containing file ('head')
:echo expand('%:p:h:t') def First get the full path with :p (/abc/def/my.txt), then get the head of that with :h (/abc/def), then get the tail of that with :t (def)
:echo expand('%:r') def/my name of file less one extension ('root')
:echo expand('%:e') txt name of file's extension ('extension')
service check : pour envoyer un status (0,1,2) et un message à la mode Nagios
https://docs.datadoghq.com/developers/service_checks/
Un soft pour avoir son feed de subscription dans l'ordre chronologique (et pas dans l'ordre "algo youtube")
Seul probleme, c'est un client lourd :-(
Il doit surement exister la meme chose en web
Time to move from Freenode to Libera
# filter out all elements not with x > 5
a = [el for el in data if el['x'] > 5]
# get all the 'c' attributes as a list
b = [el['c'] for el in data]
# get all the 'c' attributes for the elements with x > 5
c = [el['c'] for el in data if el['x'] > 5]
In Jinja2:
a: {{ data | selectattr('x', 'gt', 5) | list }}
b: {{ data | map(attribute='c') | list }}
c: {{ data | selectattr('x', 'gt', 5) | map(attribute='c') | list }}
kms different accounts : permissions on both side (policy key side and user/role side)
Petit point vocabulaire : un "Operator" est un "controller" qui va surveiller des CRD (Custom Resource Definition) pour faire des actions
Un Operator = 1 deployment = x Pods qui écoutent via l'API de Kube les events sur une CRD et va faire des actions en conséquence
distante : git push origin --delete [nom_de_la_branche]
Ce truc obscur qui t'arrive et où la solution se trouve au fond d'une PR
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
Sometime you cant use sed :(
with open('file.txt', 'r') as file :
filedata = file.read()
filedata = filedata.replace('ram', 'abcd')
with open('file.txt', 'w') as file:
file.write(filedata)
le plugin Ack permet de chercher dans le repertoire courant de vim (celui qu'on voit avec :pwd)
Pour chercher seulement dans un seul repertoire, il faut changer ce repertoire courant. Quelques commandes pratiques :
:Gcd (fournit par fugitive vim) permet de remonter à la racine du repot git
Dans nerdtree, si on se place sur un repertoire et qu'on fait 'cd', le repertoire courant de vim est changé
Une fois dans le bon repertoire, on peut chercher avec :Ack! pattern