Skip to content

Instantly share code, notes, and snippets.

@EvgenyOrekhov
EvgenyOrekhov / download-current-flickr-image.js
Last active May 17, 2021 19:29
A bookmarklet for downloading currently viewed Flickr image in the biggest available size
/*jslint browser, maxlen: 80 */
/*global DOMParser, fetch */
(function () {
"use strict";
var originalSizeLink = document.querySelector(".Original > a");
var canonicalUrl = document.querySelector("#canonicalurl").href;
var biggestSizeUrl = canonicalUrl + "/sizes/k/";
var secondBiggestSizeUrl = canonicalUrl + "/sizes/h/";
@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,
@EvgenyOrekhov
EvgenyOrekhov / A tiny jQuery plugin that watches forms change and warns the user if they forget to submit one.md
Last active May 17, 2020 09:11
dirtyForm - a tiny jQuery plugin that watches forms change and warns the user if they forget to submit one

dirtyForm

A tiny jQuery plugin that watches forms change and warns the user if they forget to submit one

Google Chrome onbeforeunload dialog

Usage examples

// Watch #my-form
$("#my-form").dirtyForm();
@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 / Docker Compose files for PHP development.md
Last active April 16, 2024 18:03
Simple Docker Compose files for PHP development

Simple Docker Compose files for PHP development

Apache + PostgreSQL + MySQL

docker-compose -f docker-compose.apache.yml up

nginx + Apache + PostgreSQL + MySQL

docker-compose -f docker-compose.nginx+apache.yml up

nginx + PHP-FPM + PostgreSQL + MySQL

docker-compose -f docker-compose.nginx+php-fpm.yml up

@EvgenyOrekhov
EvgenyOrekhov / A POSIX shell script for running command-line tools in containers.md
Last active August 21, 2024 18:30
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 / A simple Docker and Docker Compose install script for Ubuntu.md
Last active September 26, 2024 10:11
A simple Docker and Docker Compose install script for Ubuntu

A simple Docker and Docker Compose install script for Ubuntu

Usage

  1. sh install-docker.sh
  2. log out
  3. log back in

Links

/*jslint node, es6, maxlen: 80 */
"use strict";
function upperCaser(input) {
return input.toUpperCase();
}
module.exports = upperCaser;
@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": "Мастер"},