Skip to content

Instantly share code, notes, and snippets.

View Ulv's full-sized avatar
🤔
Working

Ulv Ulv

🤔
Working
View GitHub Profile
---
# Nginx vHost Template defintion for vhost-gen.py
#
# The 'feature' section contains optional features that can be enabled via
# conf.yml and will then be replaced into the main vhost ('structure' section)
# into their corresponding position:
#
# __XDOMAIN_REQ__
# __PHP_FPM__
# devilbox: docker-compose.override.yml
version: '2.3'
services:
clickhouse:
image: yandex/clickhouse-server
networks:
app_net:
ipv4_address: 172.16.238.2
ports:
@Ulv
Ulv / phpdox.xml
Created August 14, 2018 11:20
phpdox working config
<?xml version="1.0" encoding="utf-8" ?>
<!-- This is a skeleton phpDox config file - Check http://phpDox.de for latest version and more info -->
<phpdox xmlns="http://xml.phpdox.net/config" silent="false">
<!-- @silent: true | false to enable or disable visual output of progress -->
<!-- Additional bootstrap files to load for additional parsers, enrichers and/or engines -->
<!-- Place as many require nodes as you feel like in this container -->
<!-- syntax: <require file="/path/to/file.php" /> -->
<bootstrap />
@Ulv
Ulv / pre-push
Last active August 14, 2018 11:19
Автоматическое обновление документации по хуку pre-push
#!/bin/sh
rm -rf "$(pwd)/docs"
phpmd ./src xml cleancode,codesize,controversial,design,naming,unusedcode > "$(pwd)/build/pmd.xml"
phpcs ./src --report-xml="$(pwd)/packages/bitcoin/build/phpcs.xml"
phploc ./src --log-xml="$(pwd)/build/phploc.xml"
phpdox && git add --all docs && git commit -m "Автоматическое обновление документации phpdox"
@Ulv
Ulv / fastKeysCallback.php
Last active January 3, 2017 10:21
Function to apply callback to multiple keys defined by pattern.fastKeysCallback() uses redis SCAN with 100 elements
$redis = new Redis();
$redis->pconnect('127.0.0.1', 33379);
/**
* @param $redis
* @param string $mask
* @param $callback
*
* @return array|bool
*/
@Ulv
Ulv / mysql_createdb.sql
Last active January 10, 2017 12:16
Creates mysql database and user with permissions
CREATE DATABASE IF NOT EXISTS dbname;
GRANT ALL PRIVILEGES ON dbname.* TO 'dbuser'@'localhost' IDENTIFIED BY 'dbpassword';
FLUSH PRIVILEGES;
@Ulv
Ulv / createdb.sh
Created May 21, 2016 10:00
Create mysql database and user
#!/bin/bash
EXPECTED_ARGS=3
E_BADARGS=65
MYSQL=`which mysql`
Q1="CREATE DATABASE IF NOT EXISTS $1;"
Q2="GRANT ALL ON *.* TO '$2'@'localhost' IDENTIFIED BY '$3';"
Q3="FLUSH PRIVILEGES;"
SQL="${Q1}${Q2}${Q3}"
@Ulv
Ulv / gist:4f5b40c1c891014ff66c5d474cddf8e6
Created May 21, 2016 09:18
Rewrite git commiter in repository
git filter-branch --commit-filter 'export GIT_AUTHOR_NAME="author" ; export GIT_AUTHOR_EMAIL=email@mail.com; git commit-tree "$@"'
@Ulv
Ulv / .gitignore
Created January 24, 2015 12:18
Ignore emacs autosave files, .projectile and TAGS
TAGS
.projectile
\#*
*~
.#*
\#*\#
@Ulv
Ulv / gist:b5372b43279e60b3b8e6
Created January 17, 2015 15:18
JavaScript GET parameter to object - fill form field
/*
* автоматом отмечает значения, которые пришли в переменных GET
* запрос - строка вида worktype=100&second=35
*
* Здесь:
* worktype - имя и значение option основного селекта
* second - имя и значение option зависимого (второго) селекта
*/
$.fn.extend({