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
# import cv2 library
import cv2
# read the images
english = cv2.imread('english.png')
hungarian = cv2.imread('hungarian.png')
slovak = cv2.imread('slovak.png')
im_h = cv2.hconcat([english, hungarian, slovak])
@gonaumov
gonaumov / the_prince.py
Created February 26, 2024 11:06
A simple script which displays how many years ago was written "The Prince" by Machiavelli.
from datetime import datetime
def years_until_now(input_year):
return int(datetime.now().strftime('%Y')) - input_year
the_prince_written_year = 1513
print(f'"The prince" was written {years_until_now(the_prince_written_year)} ago.')
@gonaumov
gonaumov / random_items.py
Created January 12, 2024 16:32
Random item generator
import random
first_group = [1, 2, 3]
second_group = [5, 4, 6]
third_group = [7, 8, 9]
def print_winner(group, group_name):
print(f'The winner from {group_name} is {random.choice(group)}')
actor_name = input()
academy_scores = float(input())
number_of_evaluators = int(input())
needed_scores = 1250.5
for _ in range(number_of_evaluators):
evaluator_name = input()
scores_evaluator_gave = float(input())
received_scores = (len(evaluator_name) * scores_evaluator_gave) / 2
fun main() {
for (i in 1..10) {
// Here we provide the logic
// which must be repeated
}
}
// imagine this is the place where you usually
// get the response in the normal application
// you need just to pass here result variable
// it will create a .txt file with the json
// and download it. You need just to reuse this
// mock file later.
const element = document.createElement('a');
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(JSON.stringify(results, null, ' ')));
element.setAttribute('download', 'data.txt');
package converter
import java.math.BigInteger
class NumberConverter(
private val sourceBase: BigInteger,
private val targetBase: BigInteger
) {
private fun convertFromDecimal(decimalNumber: BigInteger): String {
package converter
import java.math.BigInteger
private const val MAXIMUM_OCTAL_SYSTEM = 10
private const val CAPITAL_LETTER_A = 64
class NumberConverter(
private val sourceBase: BigInteger,
package converter
fun main() {
while (true) {
println("Enter two numbers in format: {source base} {target base} (To quit type /exit)")
val userChoice = readln()
if (userChoice == "/exit") {
break;
}
val conversionBases = userChoice.split("\\s+".toRegex()).map {
@gonaumov
gonaumov / compare.sh
Created October 5, 2022 04:57
A useful one liner for comparing files containing environment variables.
sdiff -l -w 166 .env .env-old | cat -n | grep -v -e '($' | awk -F '\\|[^[:alnum:]]+' '{print $1"| "$2}' > diff.txt