Skip to content

Instantly share code, notes, and snippets.

Avatar

Danylo Hlynskyi danbst

  • Ivano-Frankivsk, Ukraine
View GitHub Profile
View resume.json
{
"meta": { "theme": "elegant" },
"basics": {
"name": "Danylo Hlynskyi",
"label": "Software engineer / DevOps / Educator",
"image": "",
"email": "danylo.hlynskyi@gmail.com",
"phone": "+380983978707",
"url": "https://github.com/danbst",
"summary": "Programmer, engineer with rich production experience: .NET GUI, game server, game client and web application backend.\n\nAlso looking for ways to improve computer science education!",
@danbst
danbst / failed_SMART.txt
Created Jan 23, 2022
Example of SMART (S.M.A.R.T.) test for failing device
View failed_SMART.txt
[nixos@nixos:~]$ sudo smartctl -a /dev/sdb
smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.10.62] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Toshiba 3.5" DT01ACA... Desktop HDD
Device Model: TOSHIBA DT01ACA200
Serial Number: 84QBH18TS
LU WWN Device Id: 5 000039 ffad3500c
Firmware Version: MX4OABB0
View min_banknotes.md

Мінімальна кількість купюр

Тут мені підігнали простеньку задачку. Звучить вона так:

Ну допустимо у мене є монетки двушки (2грн) і п'ятішки (5грн). І з них треба зібрати певну суму грн, допустимо, 123 грн. Яка найменша кількість монеток потрібна щоб набрати цю суму?

Ну і потім задачка просить вирішити не тільки для 123 грн, а й для всіх 8 <= N <= 1000000

Математики люблять такі задачки

@danbst
danbst / all_cars.json
Last active Oct 3, 2021
Attempt to implement BeamNG.drive in python turtle
View all_cars.json
{"test1": [[[-50.0, 0, 0], [-50.0, 83.0, 1.0], [-50.0, 85.0, 32.0], [-50.0, 51.0, 35.0], [-38.167938931297705, 47.0, 131.0], [-38.167938931297705, 52.0, 131.0], [-28.571428571428573, 57.0, 175.0], [-29.239766081871345, 51.0, 171.0], [-37.31343283582089, 45.0, 134.0], [-28.901734104046245, 50.0, 173.0], [-25.641025641025642, 50.0, 195.0], [-25.380710659898476, -9.0, 197.0], [-34.96503496503497, -14.0, 143.0], [-50.0, -10.0, 43.0], [-50.0, -56.0, 43.0], [-50.0, -49.0, -2.0], [-50.0, -17.0, -4.0], [-50.0, -13.0, 20.0], [-50.0, 42.0, 22.0], [-50.0, 44.0, -5.0], [-50.0, 82.0, -0.0]], [[50.0, 0, 0], [50.0, 83.0, 1.0], [50.0, 85.0, 32.0], [50.0, 51.0, 35.0], [38.167938931297705, 47.0, 131.0], [38.167938931297705, 52.0, 131.0], [28.571428571428573, 57.0, 175.0], [29.239766081871345, 51.0, 171.0], [37.31343283582089, 45.0, 134.0], [28.901734104046245, 50.0, 173.0], [25.641025641025642, 50.0, 195.0], [25.380710659898476, -9.0, 197.0], [34.96503496503497, -14.0, 143.0], [50.0, -10.0, 43.0], [50.0, -56.0, 43.0], [50.0, -
@danbst
danbst / turtle3d_grid.py
Created Oct 1, 2021
Python turtle 3d soft render (+WASD movement and camera rotation)
View turtle3d_grid.py
"""
Черепашка вміє в 3D
Управління:
- стрілочки -- поворот
- WASD -- рух
"""
import turtle
import math
@danbst
danbst / bf.py
Created Apr 21, 2021
BRAINFCK (for python 3.9)
View bf.py
code = """V*mgE00000000000000000jU506+i$0COY&002h-WB_CVgaBj#g92IrWCCOZgaBFrWC>&kWC(--S^{JR
QvfLnV*mgE00000000000000000RI306+i$0CN@q003nGS^;DLS^{JRWCLUbgaKLuWC2qEDF)gFQ*>c;
Wlre;0001E0{{R300000000000{{R30ssI2LjV8(a~c2u0DJ**2z&u<1Y`kc0ek>o0DJ;`0AB%Q08;=d
0#0%P0000f0@?#%a&p=QX>Md?cqs$g1aoC<W^w`m0043W0001~0CEKY008<4Vsc?=Ze}iUdD;kHUukY>
bYEWs0001U1ONa4009sIdJa=`VRU6KUtei%X>?y-DFRM%0RR91DFoUGUtexvZDn6y+6rG^ZEs|CY-L|x
+6-S`adlyAZeeX@Ute+u0001T1poj5as>bY0CEKY0043Z0001T000000ssI2a{>SW00;qc00000V*&sG
000000000000IC200jU507C!(0CVyH004XeWC3deawdELY5;ryY5^GlWC9leWCIoed;n?yd;n?zJOFOU
d;w$xYXWjid;n?yd;n?z831Gg7yx7g765zzY5;ryY5_a|ZlZhvWCd#ia)5jQ1ORFQWCAw;0svnDbOL+;
Y5;=)d;n?zYXWlad;n?ypaWzEp#cE^Zf<-5WCv>ka;SU&1ORFQWCAz<0svnDd;n?zWCm*ha_(dXd;nho
Zbp0oWC&{la?ErDbOn3>Y5;ryY5^Glg8^g-WC~;pjROGyZX$dEWDIKpa_)2nbO(a~WCj@kg8^g%765zz
@danbst
danbst / trainer.py
Created Feb 22, 2021
Trainer for powers of 2, inverse powers of two and indexof in Python
View trainer.py
import time
import random
from datetime import datetime
from pprint import pprint
import pickle
import math
class PowerTwo:
"""
Trainer for powers of two
@danbst
danbst / alphabetize.py
Last active Nov 4, 2021
Пачка програм
View alphabetize.py
"""
Алфавіт-квіз, автор Al Sweigart al@inventwithpython.com, переклав Данило (danbst)
"""
import random, time
QUESTION_SIZE = 5
QUIZ_DURATION = 30
abc = {}
@danbst
danbst / maze.py
Created Nov 20, 2020
Maze generation using Randomized Prim's algorithm
View maze.py
def maze(width=10, height=10):
def sides(field, x, y):
sides_ = []
if x > 0:
sides_.append((-1,0))
if x < len(field[y]) - 1:
sides_.append((1,0))
if y > 0:
sides_.append((0,-1))
if y < len(field) - 1:
@danbst
danbst / swap.js
Created Nov 5, 2020
draw swap/rotation animation using p5.js
View swap.js
var figures = [];
var size = 50;
var margin = 1.5;
var postprocessed = false;
var centerX = 0;
let names = ["a", "b", "c", "d", "e", "f"];
function addFigure(col) {
figures.push([figures.length * size * margin, 0, col]);
}