Skip to content

Instantly share code, notes, and snippets.

View rndD's full-sized avatar
🌽

Alexey Kalmakov rndD

🌽
View GitHub Profile
// Ее нужно поставить через твою среду разработки
#include <AccelStepper.h>
// Encoder
boolean TurnDetected;
boolean Up;
const int PinCLK = 18;
const int PinDT = 17;
const int PinSW = 16;
// Ее нужно поставить через твою среду разработки, ну или положить рядом с проектом
#include <AccelStepper.h>
#include <AceButton.h>
using namespace ace_button;
// Encoder
boolean TurnDetected;
boolean Up;
@rndD
rndD / .gitconfig
Last active November 13, 2023 11:40
git config for 2022-2023
[user]
name = Alexey Kalmakov
email = [email protected]
[core]
mergeoptions = --no-ff
pager = less -r
[alias]
vlog = log --pretty='%h (%an) %s' --graph
st = status
co = checkout
@rndD
rndD / index.html
Created January 21, 2020 10:18 — forked from jenniferlynparsons/index.html
Early returns comparison (http://jsbench.github.io/#1fd9788db451f01d4b84e12bba8d706f) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Early returns comparison</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@rndD
rndD / .js
Last active April 24, 2023 18:38
ATM
// Нужно написать функцию банкомат
// * первым аргументом ты передаешь ей сколько ты хочешь снять
// * вторым массив доступным банкнот в баномате
// Функция должна вернуть массив из банкнот сумма которых ровна первому аргументу
// Желательно вернуть как можно меньше банкнот, тоесть не выдавать 100 рублей по рублю если есть 10тки.
// Пример
atm(301, [100,50,20,5,1]) // => [100, 100, 100, 1]
func minOperations(logs []string) int {
deep := 0
for _, log := range logs {
if log == "./" {
continue
}
if log == "../" {
if deep != 0 {
deep = deep - 1
func pop(alist *[]int) int {
f := len(*alist)
rv := (*alist)[f-1]
*alist = append((*alist)[:f-1])
return rv
}
func calc(b int, a int, f string) int {
@rndD
rndD / nc_log.sh
Created March 26, 2022 12:31
nc: listen 3000 and log
while true; do { echo -e 'HTTP/1.1 200 OK\r\n'; } | nc -l -p 3000 -c ; done
@rndD
rndD / resume.json
Last active May 17, 2022 14:18
My CV 2022
{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"basics": {
"name": "Alexey Kalmakov",
"label": "Fullstack/DevOps open to relocation on a global level",
"image": "",
"email": "[email protected]",
"phone": "",
"url": "",
"summary": "I’m a full stack web developer / devops who can build apps and infrastracure from the ground up.",
@rndD
rndD / yarn-lock-versions-to-package.ts
Last active October 27, 2022 22:32
Script replaces all deps versions in all `package.json`s from `yarn.lock` (yarn version 3). It works with yarn monorepo setup. Run: `yarn add @yarnpkg/parsers && npx ts-node yarn-lock-versions-to-package.ts`
import fs from 'fs';
import { parseSyml } from '@yarnpkg/parsers';
import path from 'path';
let file = fs.readFileSync('yarn.lock', 'utf8');
let json = parseSyml(file);
// function make map with all packages and their versions.