This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* media height | |
*/ | |
@media (max-height:320px){ | |
} | |
@media (min-height: 480px) { | |
} | |
@media (max-height: 600px) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var CalculateItems = function(str){ | |
try { | |
var jsonData = JSON.parse(str); | |
} catch(e) { | |
return {'data':false}; | |
} | |
var out = "\r\n" ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($) { | |
/** | |
* arrayUpdateSlice. | |
* Join arrays, update items with new data. | |
* add new items of updates array | |
* @param {array=} items basic array | |
* @param {array=} updates and new items array | |
* @returns {Array} | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Gruntfile.js: | |
'use strict'; | |
module.exports = function(grunt) { | |
grunt.initConfig({ | |
// jshint: { | |
// options: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var makeNestedObject = function(key, value, pattern){ | |
var items = key.split(pattern).reverse(); | |
var obj = value; | |
for(var i=0;i<items.length;i++){ | |
var newObj = {}; | |
newObj[items[i]] = obj; | |
obj = newObj; | |
} | |
return obj; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function betweenTag($html, $tag = 'pre'){ | |
$replace = array(); | |
$j = 0; | |
do{ | |
$new = false; | |
//Поиск открывающего тэга (одного!) | |
preg_match('%(<'.$tag.'[^>]*>)(.*)%s', $html, $m); | |
if(isset($m[1], $m[2])){ | |
//Начинаем поиски закрывающих тегов (всех до конца документа) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// url: /premer-otel/standart-premium-3/booking/2015-07-16/2015-07-25/5.... | |
// url: /premer-otel/nomera/standart-64/#booking.... | |
// transfer to : /premer-otel/nomera/standart-premium-3/ | |
getRoomUrl:function(str){ | |
var options = _.compact(str.split('/')); | |
return (options.indexOf('nomera') >= 0) | |
? str.substr(0, str.indexOf(options[options.indexOf('nomera') + 2])) | |
: options.slice(0, 2).join('/nomera/'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
module.exports = function(grunt) { | |
grunt.initConfig({ | |
autoprefixer: { | |
target: { | |
files: [{ | |
expand: true, | |
cwd: '../5tourists/web/frontend/css', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var itemIdFieldName = 'id'; // поле в котором хранится id одного элемента | |
var numberGroupPrefix = '_'; // разделитель для числовых групп | |
var maxNumberGroupItemsLength = 3; // максимальное количество уникальных элементов в числовой группе | |
// создает числовую группу по значениям | |
var createGroupByValue = function(start, end, index, type){ | |
if(!index[start + numberGroupPrefix + end]){ | |
index[start + numberGroupPrefix + end] = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MegaOffice { | |
public $page; | |
protected $dirParts = './parts/'; | |
protected $dirPages = './pages/'; | |
function __construct(){ | |
$this->page = ($_GET['page'])? $_GET['page'] : 'index'; |