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 / 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 / dom.php
Last active September 25, 2019 09:25
PHP test tasks
<?php
/**
* # Работа с DOM
*
* Написать скрипт закачивания страницы www.bills.ru, из страницы извлечь даты,
* заголовки, ссылки в блоке "события на долговом рынке", сохранить в таблицу
* bills_ru_events, имеющую такую структуру:
* * id — целое, автоинкрементарное
* * date — в формате год-месяц-день часы:минуты:секунды
@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 / 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 / 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/";