Skip to content

Instantly share code, notes, and snippets.

View GeorgiKarapetrov's full-sized avatar

Georgi Karapetrov GeorgiKarapetrov

View GitHub Profile
@GeorgiKarapetrov
GeorgiKarapetrov / colors.py
Created February 16, 2023 10:15 — forked from rene-d/colors.py
ANSI color codes in Python
# SGR color constants
# rene-d 2018
class Colors:
""" ANSI color codes """
BLACK = "\033[0;30m"
RED = "\033[0;31m"
GREEN = "\033[0;32m"
BROWN = "\033[0;33m"
BLUE = "\033[0;34m"

Keybase proof

I hereby claim:

  • I am GeorgiKarapetrov on github.
  • I am georgi_devops (https://keybase.io/georgi_devops) on keybase.
  • I have a public key whose fingerprint is 3337 5409 0A4E 5800 522D 7B5F 63BC AA9D B91D 2D60

To claim this, I am signing this object:

@GeorgiKarapetrov
GeorgiKarapetrov / Forms.java
Last active April 9, 2019 20:15
Python 101, second round entrance exam
/*
* This program seats all correct configurations in a cinema salon.
* I have taken left and right to be the mirror view left and right
* not the ususal left and right for the people in the seats
* as is the case in the example output.
*
* Credit goes to Ivan Petrov who gave the idea of using switch - case and helped simplify my solution in other ways.
* I don't know if I would have been able to finish in time and with such minimal implementation if he did not help.
*/
package forms;
@GeorgiKarapetrov
GeorgiKarapetrov / Intervals.java
Last active October 14, 2019 20:23
101 with Python, entrance exam, round 1
/*
* This program lists in ascending order the consecute intervals between any set of integer generated by a user.
*
* N.B. No mechanisms have been implemented to safeguard the user from missusing the program.
* This can be done with some conditional statements in the prompt method and reprompting the user to correct the input, as well as try/catch clauses.
*
* N.B. It is not clear what to do when the user inputs an odd number of integers.
* While a number of approaches resolve this issue, I decided to treat the largest number to appear twice.
* In other word, input:
* 1
/*
* This program lists the top three UUIDv4s with regards to the sum of their values. It outputs the value of the said sums.
* The list is user generated.
*
* N.B. No mechanisms have been implemented to safeguard the user from missusing the program.
* This can be done with some conditional statements in the prompt method and reprompting the user to correct the input, as well as try/catch clauses.
*
* N.B. It is not clear what to do when we have more than three competing values for the top three places.
* For instance, if three keys compete for the first two positions, what do we do with the next in line?
* Do we consider it to be a winner?