Skip to content

Instantly share code, notes, and snippets.

First install Virtualbox

  1. sudo pico /etc/apt/sources.list.d/virtualbox.list
  2. Add deb http://download.virtualbox.org/virtualbox/debian saucy contrib non-free
  3. wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -
  4. sudo apt-get update
  5. sudo apt-get install dkms unzip
  6. sudo apt-get install virtualbox-4.3 --no-install-recommends
  7. wget http://download.virtualbox.org/virtualbox/4.3.6/Oracle_VM_VirtualBox_Extension_Pack-4.3.6.vbox-extpack
  8. sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.3.6.vbox-extpack
@errogaht
errogaht / getNumEnding.php
Last active August 29, 2015 14:24
Функция возвращает окончание для множественного числа слова на основании числа и массива окончаний
<?php
/**
* Функция возвращает окончание для множественного числа слова на основании числа и массива окончаний
* @param $number Integer Число на основе которого нужно сформировать окончание
* @param $endingsArray Array Массив слов или окончаний для чисел (1, 4, 5),
* например array('яблоко', 'яблока', 'яблок')
* @return String
*/
function getNumEnding($number, $endingArray)
{
@errogaht
errogaht / useful_css_classes.css
Created September 9, 2015 09:29
Useful css classes
/*
* Clearfix: contain floats
*
* For modern browsers
* 1. The space content is one way to avoid an Opera bug when the
* `contenteditable` attribute is included anywhere else in the document.
* Otherwise it causes space to appear at the top and bottom of elements
* that receive the `clearfix` class.
* 2. The use of `table` rather than `block` is only necessary if using
* `:before` to contain the top-margins of child elements.
@errogaht
errogaht / drush_drupal_install.sh
Last active September 15, 2015 07:28
install drupal via drush
drush dl drupal
drush site-install standard --account-name=Drupal --account-pass=pass --db-url=mysql://user:pass@mysql/dbname
drush en migrate migrate_ui features admin_menu views transliteration globalredirect l10n_update intlinks devel entity fancybox -y
@errogaht
errogaht / mixins.scss
Last active October 1, 2015 04:23
Scss mixins
/* ================================================================================
Типографика в rem ### @include font-size(14px);
================================================================================ */
@function calculateRem($size) {
$remSize: $size / 16px;
@return $remSize * 1rem;
}
@mixin font-size($size) {
font-size: $size;
@errogaht
errogaht / ubuntu_phpstorm_fixes
Created November 12, 2015 08:48
ubuntu_phpstorm_fixes
http://onedev.net/post/469
@errogaht
errogaht / test.php
Created November 23, 2015 16:24
test.php
<?php
require_once("vendor/autoload.php");
$code = file_get_contents('settings.php');
$settings = [];
$parser = new PhpParser\Parser(new PhpParser\Lexer\Emulative);
@errogaht
errogaht / js-patterns.js
Created December 21, 2015 05:36
4 JavaScript Design Patterns You Should Know by Devan Patel (@devanp92)
/**
* 1. Module Design Pattern
* @link https://scotch.io/bar-talk/4-javascript-design-patterns-you-should-know#module-design-pattern
*/
(function () {
// declare private variables and/or functions
return {
@errogaht
errogaht / centos-7-php7
Created January 10, 2016 12:26
cent os 7 php 7 build
yum group install "Development Tools"
yum group install "Development Libraries"
yum install libxml2-devel openssl-devel git autoconf gcc bison bzip2-devel curl-devel libjpeg-devel freetype-devel libmcrypt libmcrypt-devel mhash \
mhash-devel php-mysql mysql-devel aspell-devel libtidy libtidy-devel libxslt libxslt-devel glibc-utils libtool-ltdl-devel libpng-devel db4-devel libXpm-devel \
gmp-devel libc-client-devel openldap-devel unixODBC-devel postgresql-devel sqlite-devel net-snmp-devel pcre-devel t1lib-devel recode-devel expat-devel
./configure \
--prefix=/opt/php70 \
--with-config-file-path=/opt/php70/etc \
--with-config-file-scan-dir=/opt/php70/etc/php.d \
--with-libdir=lib64 \
@errogaht
errogaht / common-height.js
Last active January 11, 2016 17:35
JavaScript Common css height for child elements
/**
* Common height for all .common-height__item placed inside parent wrapper
* with .common-height selector
*
* Example:
*
* <div class="common-height">
* <div class="common-height__item"></div>
* <div class="common-height__item"></div>
* <div class="common-height__item"></div>