Skip to content

Instantly share code, notes, and snippets.

@EvgenyOrekhov
EvgenyOrekhov / A POSIX shell script for running command-line tools in containers.md
Last active May 17, 2020 09:06
docker-run - a POSIX shell script for running command-line tools in containers

A POSIX shell script for running command-line tools in containers

Install

  1. Clone this repo

    git clone https://gist.github.com/82a78debf7dea8ab1dd4da9c034aee14.git docker-run
    
  2. Create a link to docker-run in your /usr/local/bin/

@EvgenyOrekhov
EvgenyOrekhov / Data manipulation exercise.md
Last active May 17, 2020 09:01
Data manipulation exercise

Data manipulation exercise

На любом языке программирования написать функцию, которая высчитывает количество задач по каждому статусу для каждого проекта.

Пример входных данных:

projects = [
    {"id": 2, "title": "Canape CRM"},
    {"id": 3, "title": "Мастер"},
@EvgenyOrekhov
EvgenyOrekhov / work-n-rest.md
Last active May 17, 2020 08:36
work-n-rest.sh - a POSIX shell script for executing long running tasks with pauses

work-n-rest.sh

A POSIX shell script for executing long running tasks with pauses.

Usage examples

Work for 10 seconds, then rest for 10 seconds:

./work-n-rest.sh find ./ -name '*.log'
@EvgenyOrekhov
EvgenyOrekhov / dom.php
Last active September 25, 2019 09:25
PHP test tasks
<?php
/**
* # Работа с DOM
*
* Написать скрипт закачивания страницы www.bills.ru, из страницы извлечь даты,
* заголовки, ссылки в блоке "события на долговом рынке", сохранить в таблицу
* bills_ru_events, имеющую такую структуру:
* * id — целое, автоинкрементарное
* * date — в формате год-месяц-день часы:минуты:секунды
@EvgenyOrekhov
EvgenyOrekhov / challenge.sh
Last active March 14, 2018 10:48
POSIX shell scripting challenge
#!/bin/sh
set -eu
FILES=$(find . -maxdepth 1 -type f | sort)
# -------------- #
# FIX ME #
# vvvvvvvvvvvvvv #
/*jslint node, es6, maxlen: 80 */
"use strict";
function upperCaser(input) {
return input.toUpperCase();
}
module.exports = upperCaser;
@EvgenyOrekhov
EvgenyOrekhov / animated-scroll-to-top-and-back.js
Last active February 21, 2016 16:07
A convenient "toTop" function for your "Scroll to top and back" button
/*jslint browser: true */
/*jshint laxbreak: true */
/*global requestAnimationFrame */
/**
* A convenient "toTop" function for your "Scroll to top and back" button.
* Animates page scroll to the page top,
* or to the specified "top" coordinate,
* or to the specified element's top.
* On the next click on your button, if the page hasn't been scrolled,