Skip to content

Instantly share code, notes, and snippets.

View klapauciuz's full-sized avatar
💩
fuck

Alice Polansky klapauciuz

💩
fuck
View GitHub Profile
@klapauciuz
klapauciuz / bash_tips.sh
Last active June 27, 2024 16:51
some bash hints for lists manipulation
# get first column(from file with ':' delimeter) and write into output.csv
cut -f1 -d':' input.csv >> output.csv
# get from first up to five column from dataset.csv
cut -f1-5 -d',' dataset.csv
# regex for json-type html parsing
\:(?:[^\:]*)@\C+
# get first column from output.csv
awk -F, '!seen[$1]++' output.csv >> uuu.csv
@klapauciuz
klapauciuz / g.py
Last active September 28, 2017 22:55
wonderful tricky python oneliner with open and close file and two nested loops one of which is generator
with open('output.txt', 'a') as o:contents=[o.write('http://' + random.choice(['1', '2', '3', '4', '5']) + str(random.randrange(100, 1000)) + i + '\n') for i in ['one', 'two', 'три', 'four', 'V'] for x in xrange(100)]