Сообщения

vertical-align eventually

https://web-standards.ru/articles/vertical-align/

grid css colorize even, odd

its not possible with css but some workaround  https://keithclark.co.uk/articles/targeting-first-and-last-rows-in-css-grid-layouts/

regex crap

Using 1.*1, * is greedy - it will match all the way to the end, and then backtrack until it can match 1, leaving you with 1010000000001. .*? is non-greedy. * will match nothing, but then will try to match extra characters until it matches 1, eventually matching 101. All quantifiers have a non-greedy mode: .*?, .+?, .{2,6}?, and even .??. http://www.rexegg.com/regex-quantifiers.html#cheat_sheet https://stackoverflow.com/questions/3075130/what-is-the-difference-between-and-regular-expressions

mockitos crap

How to make mock to void methods with mockito doAnswer(i -> {   ((Runnable) i.getArguments()[0]).run(); // ! нужно сделать i.callRealMethod()   return null; }).when(executor).execute(any()); https://stackoverflow.com/questions/2276271/how-to-make-mock-to-void-methods-with-mockito mockito:  https://www.youtube.com/watch?v=Z1WD5Jj9dH4 mockbean это по умолчанию вырубаются все вызовы методов. поэтому spybean чтобы замокать только те что надо? https://stackoverflow.com/questions/11620103/mockito-trying-to-spy-on-method-is-calling-the-original-method 

postgres troubleshooting

pg_dump -C -h localhost -U localuser dbname | psql -h remotehost -U remoteuser dbname src:  https://stackoverflow.com/questions/1237725/copying-postgresql-database-to-another-server ++++++++++++++++++++ \list or \l: list all databases \dt: list all tables in the current database You will never see tables in other databases, these tables aren't visible. You have to connect to the correct database to see its tables (and other objects). To switch databases: \connect database_name src: https://dba.stackexchange.com/questions/1285/how-do-i-list-all-databases-and-tables-using-psql -------------------------------- SELECT * FROM   pg_trigger WHERE  tgrelid = 'stakertech.public.blocks'::regclass; -> tgname = 'RI_ConstraintTrigger_a_16588'; tgname = 'RI_ConstraintTrigger_a_16589'; and because of these restrictions on the blocks table deletion on condition coin_id became VERY slow. so ALTER TABLE blocks DISABLE TRIGGER ALL; delete ... AL...

intellij

if u wanna replace with capturing group (src: https://www.jetbrains.com/help/idea/tutorial-finding-and-replacing-text-using-regular-expressions.html) (.)+ this won't work but (.)? will work. yes, strange.

add user with ssh pub key unix

sudo mkdir /home/tomcat8 sudo groupadd tomcat8 sudo useradd -s /bin/sh -g tomcat8 -d /home/tomcat8 tomcat8 usermod -s /bin/sh tomcat8 change user cli usermod -a -G sudo tomcat8 groups groups username chmod 700 -R /home/user sudo chmod 700 /home/user/.ssh sudo chmod 600 /home/almas/.ssh/authorized_keys execute sudo cmd without passwd: sudo visudo In the bottom of the file, type the follow: username ALL=(ALL) NOPASSWD: ALL