Skip to content

Instantly share code, notes, and snippets.

View gonaumov's full-sized avatar
💭
a status

George Naumov gonaumov

💭
a status
View GitHub Profile
### Keybase proof
I hereby claim:
* I am gonaumov on github.
* I am georginaumov (https://keybase.io/georginaumov) on keybase.
* I have a public key ASBqrhcUN9MAPwhe5lwNqzKBnBKpQDm3_PoDsbEebHYG1Qo
To claim this, I am signing this object:
@gonaumov
gonaumov / Main.java
Created June 11, 2021 05:33
What is my age?
// You have the class Tree:
class Tree {
String sort;
int age;
double height;
}
/**
After you execute the following code,
@gonaumov
gonaumov / replacer.sh
Last active March 28, 2021 12:19
Replace a semicolon (;) with a greek question mark (;)
# --------------------------------------------------------------------------------------
# Note: This bash one linner had been written just for education and demonstration
# purposes only. Don't actually use it. It would be very bad joke with your friend! :)
# It will replace usage of semicolon (;) with Greek question mark in all
# C#, JavaScript and TypeScript files in the directory recursively.
# --------------------------------------------------------------------------------------
#
# Replace a semicolon (;) with a greek question mark (;) in your friend's
# C#, JavaScript or TypeScript code and watch them pull their hair over the syntax error ...
# They don't understand it, but their arms go rubbery and their throats constrict.
# There was need to convert subtitles encoding in a directory. We - me and my wife use one Ubuntu desktop box
# to watch movies. Linux users are used to meet these specific encoding problems if there is cirillyc.
# I wrote this one liner in order to convert all subtitles in a directory.
# xargs rocks - in that case xargs executes recode windows-1251 for every file which has extenstion .srt
ls -A1 | egrep "\.srt'?$" | xargs -n 1 recode windows-1251
@gonaumov
gonaumov / report.sh
Last active December 28, 2020 13:10
How to get report for developers commit it a repository using Linux command line
#!/usr/bin/env bash
git log | egrep -o "<[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}>" | sort | uniq -c | sort -nk1 -r | awk 'BEGIN {printf "Commits reports from developers:\n"; total=0; } { total+=$1; print } END { printf " " total " total commits\n" }' > report.txt
["Yes, definitely", "Signs show yes", "Doesn't look good", "Looks good", "Rely on this", "Vague answer, ask again", "Ask later", "My answer is no","As I see it - yes","No doubt","Sources tell me no","Definitely","I can't predict now","Concentrate and ask again","No!","Very likely","Yes","Not after a million years","Undoubtedly yes","I better not say","Very doubtful"]
ls -A1R src/components/ | egrep '.tsx$' | awk 'BEGIN { printf "Components in the code base:\n"; printf ("N component-file recommended-id\n")} {printf(NR);printf(" %s ",$1); printf(" "); gsub(/.tsx$/,""); gsub(/\./,"-"); print $0} END {print "Total", NR}' > report.txt
git log --name-status HEAD~1..HEAD | egrep '^(A|M)\s+' | awk 'BEGIN {modified=0;added=0; printf "Git changes statistick\n";} {if($1 == "M") modified++; else if($1== "A") added++} END { printf "Modified " modified; printf " Added " added }'
ls -1 src/www/images/armani-bag/* | egrep -e '-large-' | xargs rm
class Complex {
double real;
double imaginary;
}