Skip to content

Instantly share code, notes, and snippets.

View evdokimovm's full-sized avatar

Mikhail Evdokimov evdokimovm

View GitHub Profile
@evdokimovm
evdokimovm / pomodoro.py
Last active March 20, 2024 04:58
pomodoro timer in python
import winsound
import tkinter as tk
from PIL import Image, ImageDraw, ImageTk
class PomodoroClock:
def __init__(self, master):
self.master = master
self.total_time_in_seconds = 0
self.elapsed_time_in_seconds = 0
self.timer_running = False
@evdokimovm
evdokimovm / Microsoft.PowerShell_profile.ps1
Created February 14, 2024 09:29
My PowerShell 7 Microsoft.PowerShell_profile.ps1 profile
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\amro.omp.json" | Invoke-Expression
Import-Module Terminal-Icons
Import-Module PSReadLine
New-Alias code code-insiders
New-Alias curl C:\curl-7.81.0-win64-mingw\bin\curl.exe
Remove-Alias md
function md {
param (
@evdokimovm
evdokimovm / index.html
Last active February 15, 2024 08:13
chess puzzles from The Password Game with answers
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Chess Puzzles from The Password Game with Solutions</title>
</head>
<body>
<style>
#container {
display: flex;
@evdokimovm
evdokimovm / index.html
Last active January 26, 2024 02:44
drag a box around the screen and drop it onto one of three target areas. check if the draggable element is inside any of the target elements
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
margin: 0;
padding: 0;
}
@evdokimovm
evdokimovm / get_rank_by_RP.py
Created January 17, 2024 12:33
get rainbow six siege r6s rank by rp mmr ranked points
def value_to_rank(RP):
titles_list = ['Copper', 'Bronze', 'Silver', 'Gold', 'Platinum', 'Emerald', 'Diamond', 'Champion']
min_value = 1000
rank_interval = 500
increment = 100
if RP <= 1000:
return 'Copper 5'
@evdokimovm
evdokimovm / three-phases.py
Last active January 16, 2024 18:05
visualize three phases of electrical system
import matplotlib.pyplot as plt
import numpy as np
import mplcursors
x = np.linspace(0, 500, 1000)
plt.figure(figsize=(10, 6))
plt.axhline(y=0, color='k', linestyle='-')
@evdokimovm
evdokimovm / index.js
Last active September 2, 2023 16:19
promise wrapper for chrome.storage.local.set and chrome.storage.local.get operations for chrome extensions
async function promiseWrapper(options, callback) {
return new Promise((resolve, reject) => {
try {
callback(options, resolve)
} catch (err) {
reject(err)
}
})
}
@evdokimovm
evdokimovm / has_enough_space.py
Created May 16, 2023 05:11
check if the square matrix has enough space to fit the Tetris shape in using numpy
def check_space(matrix):
shape = [
[1, 1, 0],
[1, 0, 0],
[1, 0, 0]
]
shape_height = len(shape)
shape_width = len(shape[0])
matrix_height = len(matrix)
@evdokimovm
evdokimovm / index.html
Last active April 19, 2023 16:11
pie chart on js canvas. no libs
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Pie Chart</title>
</head>
<body>
<div class="chart-container">
@evdokimovm
evdokimovm / index.html
Created April 2, 2023 12:47
tree comments structure simple client side example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>