Skip to content

Instantly share code, notes, and snippets.

View index0h's full-sized avatar

Roman Levishchenko index0h

View GitHub Profile
@index0h
index0h / Concatenation.php
Created July 5, 2013 07:49
Скрипт, демострирующий как можно обойти eval для нахождения результата конкатенации строк.
<?php
/**
* Скрипт, демострирующий как можно обойти eval для нахождения результата конкатенации строк.
*
* @category INDEX0H
* @package MAIN
* @subpackage SCRIPTS
* @author Roman Levishchenko <index.0h@gmail.com>
* @copyright 2013 Roman Levishchenko
* @license BSD
@index0h
index0h / postinstall.sh
Last active August 29, 2015 13:56
Ubuntu 13.10 under Vagrant After install script (not finished)
###################################################################################################
# APT
apt-get -y update
apt-get -y upgrade
apt-get -y install linux-headers-$(uname -r) build-essential automake autoconf zlib1g-dev libssl-dev \
libreadline-gplv2-dev libyaml-dev vim dkms nfs-common zip unzip mc curl software-proprieties-common
###################################################################################################
###################################################################################################
# Vagrant
@index0h
index0h / mysql-tunnel.sh
Last active January 5, 2016 15:58
mysql-tunnel.sh
#!/bin/bash
# Необходимо задать три массива: PORTS, PROXY_HOSTS и HOSTS.
# При подключении будут созданы туннели PROXY_HOSTS[id]:PORTS[id] -> HOSTS[id]:3306.
# HOSTS - массив хостов, к которым будет выполнятся ssh подключение (рекомендую использовать ssh-ключи).
PORTS=('33061')
PROXY_HOSTS=('127.0.0.1')
HOSTS=('external.host')
#!/bin/bash
#=============================================================================
#
# FILE: list_dates.sh
#
# USAGE: list_dates.sh start_date end_date
#
# DESCRIPTION: List the dates between a given range of dates.
#
#=============================================================================
@index0h
index0h / yii1-translation-behavior.php
Created November 18, 2014 08:27
yii1-translation-behavior
<?php
/**
* Поведение для стандартизированной работы с переводами.
*
* Подготовка.
* Создаем основную модель.
*
* - **ДОЛЖНА НЕ** иметь переводимых полей.
* - **ДОЛЖНА** иметь поле id.
* - Основная модель не обязана иметь прописанную связь с моделью переводов.
@index0h
index0h / History.php
Created March 29, 2015 23:39
History.php
<?php
/**
* Поведение для отслеживания изменений.
*
* **ВНИМАНИЕ!!!**
* Данное поведение не работает с моножественными действиями: update и delete, будьте внимательны.
*
* ### Подготовка:
*
* - Необходимо создать такую же таблицу с суфиксом **_history**, как отслежуемая, но с дополнительными полями:
@index0h
index0h / commit_name.sh
Created April 15, 2015 11:49
Commit name maker
#!/bin/bash
# Current script works with branches by next standars:
# dev-{YYYYmmdd}-{surname}-N{ticket number}-{ticket name}
# dev-{YYYYmmdd}-{surname}-{ticket number}-{ticket name}
#
# {YYYYmmdd} - branch creation date
# {surname} - authors surname
# {ticket number} - number of ticket in your bug tracker
# {ticket name} - short ticket description, words could be separated by - or _
################################### General ####################################
## Sentry server name. This is the base URL that Cyclops will use to send
## requests to sentry.
## Defaults to: localhost:9000
SENTRY_BASE_URL = '{{ SENTRY_HOST_HERE }}'
################################################################################
################################# Performance ##################################
thrift_service:
constructor: NewThriftService
arguments:
- "%visit_handler%"
- "%event_handler%"
- "%flash_handler%"
- "%track_handler%"
- "%mark_handler%"
- "localhost:9090"
- binary