This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xclip -sel clip < ~/.ssh/id_rsa.pub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
################################################################################ | |
# scriptTemplate | |
################################################################################ | |
################################################################################ | |
################################################################################ | |
# # | |
# Copyright (C) 2020 Maksym Voitko # | |
# [email protected] # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Terraform 3 hrs 57 mins █████████▍░░░░░░░░░░░ 45.0% | |
YAML 2 hrs 44 mins ██████▌░░░░░░░░░░░░░░ 31.2% | |
Bash 51 mins ██░░░░░░░░░░░░░░░░░░░ 9.7% | |
Python 40 mins █▌░░░░░░░░░░░░░░░░░░░ 7.7% | |
Other 25 mins █░░░░░░░░░░░░░░░░░░░░ 4.9% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// При кодировании информации каждый символ заменяется на свой код. | |
// Декодирование для префиксных кодов однозначно и выполняется слева направо. | |
// Чтобы эффективно реализовать процесс декодирования, необходимо хранить информацию о коде в удобной форме. | |
// Например, можно представить код в виде двоичного дерева, листья которого соответствуют кодируемым символам. | |
// А путь от вершины дерева до кодируемого символа определяет кодирующую последовательность битов: поворот налево дает 0, направо — 1. | |
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.util.HashMap; | |
import java.util.Map; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Step 1. Requirements clarifications: | |
1.1 Define use cases with interviewers help. | |
Who is going to use it? | |
How are they going to use it? | |
What does the system do? | |
What are the inputs and outputs of the system? | |
1.2 Ask about additional features. | |
1.3 Remove items that interviewer deems out of scope. | |
1.4 Assume high availability required. Add as a use case. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def read_tokens(): | |
return input().strip().split() | |
def read_ints(): | |
return [int(s) for s in read_tokens()] | |
a, = read_ints() # 1 int | |
a, b, c = read_ints() # several |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bisect | |
# very useful for the following kind of data: | |
# https://taxfoundation.org/2016-tax-brackets/ | |
cuts = [60, 70, 80, 90] | |
grades = 'FDCBA' | |
[grades[bisect.bisect(cuts, score)] for score in [32, 64, 70, 85, 90, 99, 100]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void bubbleSort(int[] a) | |
{ | |
int n = a.length; | |
for (int j = 0; j < n - 1; ++j) | |
{ | |
for (int i = 0; i < n - j - 1; ++i) | |
{ | |
if (a[i] > a[i+1]) | |
{ | |
swap(a, i, i+1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import deque | |
from dataclasses import dataclass | |
class LRUCache: | |
@dataclass | |
class Node: | |
"""Doubly Linked List (DLL) Node class to store value to be cached""" | |
key: int = None | |
val: int = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
changed: [localhost] => (item={u'folder': u'org/jenkins-ci/ui', u'version': u'1.1', u'name': u'ace-editor'}) | |
failed: [localhost] (item={u'version': u'2.28.1', u'name': u'allure-jenkins-plugin'}) => {"changed": true, "cmd": ["java", "-jar", "/opt/jenkins-cli.jar", "-i", "/var/lib/jenkins/.ssh/jenkins_deploy_key", "-s", "http://localhost:8080/", "-remoting", "install-plugin", "https://repo.jenkins-ci.org/releases/org/jenkins-ci/plugins/allure-jenkins-plugin/2.28.1/allure-jenkins-plugin-2.28.1.hpi", "-name", "allure-jenkins-plugin"], "delta": "0:00:02.250731", "end": "2019-10-22 15:36:35.991978", "item": {"name": "allure-jenkins-plugin", "version": "2.28.1"}, "msg": "non-zero return code", "rc": 1, "start": "2019-10-22 15:36:33.741247", "stderr": "\nERROR: Unexpected exception occurred while performing install-plugin command.\njava.io.FileNotFoundException: https://repo.jenkins-ci.org/releases/org/jenkins-ci/plugins/allure-jenkins-plugin/2.28.1/allure-jenkins-plugin-2.28.1.hpi\n\tat sun.net.www.protocol.http.Htt |
NewerOlder