Skip to content

Instantly share code, notes, and snippets.

View hergerr's full-sized avatar
🐧
enjoying GNU/Linux

Tymoteusz Frankiewicz hergerr

🐧
enjoying GNU/Linux
  • Switzerland
View GitHub Profile
@hergerr
hergerr / utils.sh
Created December 23, 2021 17:51
Utils for web develepment, that I use pretty seldom and constantly forget
# upload via ftp
ncftpput -R -v -u "login" cluster.address /destination/folder /local/src/folder/*
import sys
with open(f'{sys.argv[1]}/GT-{sys.argv[1]}.csv') as file:
next(file)
for line in file:
lst = line.rstrip('\n').split(';')
with open(f'{sys.argv[1]}/{lst[0][0:-4]}.txt', 'w') as w_file:
w_file.write(f'{lst[-1]} {int((int(lst[3]) + int(lst[5]))/2)} {int((int(lst[4]) + int(lst[6]))/2)} {abs(int(lst[5]) - int(lst[3]))} {abs(int(lst[4]) - int(lst[6]))}')
@hergerr
hergerr / app.py
Created May 5, 2019 11:02
Bytearray to list of lists
def dec_to_bin(lst):
bin_matrix = []
# kazda wartosc ma nowy wiersz w macierzy
for i in lst:
bin_matrix.append(list(bin(i)[2:]))
bin_matrix_int = [list(map(int, x)) for x in bin_matrix]
return bin_matrix_int