Skip to content

Instantly share code, notes, and snippets.

View exelay's full-sized avatar
👊
fight procrastination

Alexey Kirpa exelay

👊
fight procrastination
  • Saint-Petersburg
View GitHub Profile
@exelay
exelay / kubectl_ubuntu_wsl.sh
Created March 13, 2023 12:51 — forked from cmendible/kubectl_ubuntu_wsl.sh
Install kubectl on ubuntu (WSL) and use kubectl config from Windows
#!/bin/bash
# Receives your Windows username as only parameter.
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.16.0/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
windowsUser=$1
@exelay
exelay / loop_search_in_linked_list.py
Created August 6, 2022 20:18
Алгоритм поиска цикла в связанном списке
from typing import Any, Optional
# Простая реализация связанного списка
class Node:
def __init__(self, value: Any):
self.value: Any = value
self.next: Optional[Node] = None
@exelay
exelay / quick_sort.py
Last active August 6, 2022 18:14
Подробное описание алгоритма быстрой сортировки
def _partition(nums: list, first: int, last: int) -> int:
"""
Выбираем опорный элемент.
Используем схему Хоара, так как она использует меньше перестановок
"""
pivot = nums[(first + last) // 2] # Предварительно в качестве опорного выбираем средний элемент массива
i = first - 1 # задаём курсоры поиска индексами первого и последнего элемента входного массива,
j = last + 1 # смещёнными на одну позицию за границы массива, для компенсации последующего движения в цикле
# Двигаемся по левой и правой части массива, по направлению к опорному, сравнивая элементы с опорным,
@exelay
exelay / api_docs.md
Last active November 2, 2020 07:19
Docs and data for the "cars" project.

Scrapers API Docs

API methods

startSearch

A POST method that starts searching process and return response with JSON that contain status and unique search token. This token will be needed to get search results in the getResults method.

Parameter Type Required Description
brand* String Yes Car brand requested by the user.