Skip to content

Instantly share code, notes, and snippets.

View mikeyakymenko's full-sized avatar
🏠
Working from home

Mike Yakymenko mikeyakymenko

🏠
Working from home
View GitHub Profile
const probs = {
0: {
0: 0.7,
1: 0.14,
2: 0.1,
3: 0.03,
4: 0.02,
5: 0.01
},
1: {
@mikeyakymenko
mikeyakymenko / package.json
Created February 7, 2020 15:50
Simple NodeJS + TS
{
"name": "someproject",
"version": "1.0.0",
"description": "someproject shop",
"main": "index.js",
"author": "Mike Yakymenko",
"license": "MIT",
"scripts": {
"dev": "nodemon --watch 'src/**/*.ts' --exec 'ts-node' server.ts",
"prod": "tsc -p api && node dist/server.js"
import * as mongoose from 'mongoose'
import {AdressDbModel} from './types'
const adressSchema = new mongoose.Schema({
country: {
type: String,
required: true
},
city: {
@mikeyakymenko
mikeyakymenko / robin_like_schedule.py
Last active October 21, 2021 15:42
Robin like schedule
def scheduleMatches(teams, rounds=1):
matches = []
if len(teams) % 2 == 1:
teams.append('None')
teamsNumbers = len(teams)
map = list(range(teamsNumbers))
middle = teamsNumbers // 2
for i in range((teamsNumbers-1)*rounds):
@mikeyakymenko
mikeyakymenko / season.py
Last active May 5, 2024 22:07
schedule unbalanced season (sports)
from app.core.constants import Directions
class SeasonSchedule:
def __init__(self, units, season_shift=None):
self.units = units
self.north_units = [unit for unit in units if unit['division'] == Directions.North.value]
self.south_units = [unit for unit in units if unit['division'] == Directions.South.value]
self.season_shift = list(range(5)) if season_shift is None else season_shift
self.weeks = []