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 / 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 / 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
#COMMON
sudo apt-get install htop software-properties-common git mc nano gcc make supervisor -y
cat ~/.ssh/id_rsa.pub | ssh user@host "cat >> ~/.ssh/authorized_keys"
#LOCALE
#=====================================================================#
locale -a
sudo dpkg-reconfigure locales
sudo locale-gen ru_RU
sudo locale-gen ru_RU.UTF-8
sudo update-locale
@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 / 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 / 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>
@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 {