Skip to content

Instantly share code, notes, and snippets.

View Burick's full-sized avatar
🏠
Работаю из дома

Burick Burick

🏠
Работаю из дома
View GitHub Profile
@Burick
Burick / clear-select
Last active August 29, 2015 14:27 — forked from meyercc/clear-select
LESS Mixin that clears browsers' default select box styles.
.clear-select {
border: none;
border-radius: 0;
outline: none;
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
-o-appearance: none;
text-indent: 0.01px; // Need this to hide default select in FF
text-overflow: ''; // Need this to hide default select in FF
@Burick
Burick / input.css
Last active September 3, 2015 11:35
Cross-browser input styling
.input.default {
appearance: none;
width: 180px;
height: 30px;
background-color: white;
border: 1px solid #c9c9c9;
border-radius: 3px;
box-shadow: none;
outline: none;
padding: 4px;
<?php
if ($modx->context->key !== 'mgr' ) {
$parts = array_reverse(explode('/', $_SERVER['REQUEST_URI']));
if ($parts[0]) {
$alias = str_replace('.html', '', $parts[0]);
} else {
$alias = $parts[1];
}
if ($res = $modx->getObject('modResource', array('alias' => $alias))) {
/**
* The first create app to link https://console.developers.google.com
* Later save json file of created app to own site. Path to the file transmit to GoogleHandler initialize method
*
* composer.json
* {
* "require": {
* "asimlqt/php-google-spreadsheet-client": "2.3.*", // https://github.com/asimlqt/php-google-spreadsheet-client
* "google/apiclient": "^2.0.0@RC"
* }
<div class='row ms2_product col-md-4' itemtype='http://schema.org/Product' itemscope>
<meta itemprop='description' content='[[+description:default=`[[+pagetitle]]`]]'>
<div class='prev'>
<a href='[[+uri]]'>
<img src='[[+thumb:default=`[[++assets_url]]components/minishop2/img/web/ms2_small.png`]]' itemprop='image'
alt='[[+pagetitle]]' title='[[+pagetitle]]'>
</a>
</div>
<h3 class='tm-title' itemprop='name'>[[+pagetitle]]</h3>
@Burick
Burick / chunk.product.content.tpl
Last active September 26, 2018 18:14 — forked from vgrish/chunk.product.content.tpl
Карточка товара
<div class='tm-product'>
<h1>[[*pagetitle]]</h1>
<div id='msProduct' class='row' itemtype='http://schema.org/Product' itemscope>
<meta itemprop='name' content='[[*pagetitle]]'>
<meta itemprop='description' content='[[*description:default=`[[*pagetitle]]`]]'>
<div class='span5 col-md-5 col-sm-6'>
[[!msGallery@bsMsGallery]]
</div>
<div class='span7 col-md-7 col-sm-5' itemtype='http://schema.org/AggregateOffer' itemprop='offers' itemscope>
<meta itemprop='category' content='[[#[[*parent]].pagetitle]]'>
@Burick
Burick / setequalheight.js
Last active April 4, 2017 11:55
Вычисляет самый высокий столбец и все остальные в наборе делает по его высоте
/*
функция опледеления элемента
с наибольшей высотой
*/
$(function(){
function setEqualHeight(columns){
var tallestcolumn = 0;
columns = $(columns);
@Burick
Burick / slowscroll.js
Created April 27, 2016 12:43
плавная прокрутка к якорю
$('a[href^="#"]').click(function(){
var el = $(this).attr('href');
$('body').animate({
scrollTop: $(el).offset().top}, 2000);
return false;
});
@Burick
Burick / formated_price.js
Created May 24, 2016 12:16
Форматирование цены Js
/*
layerPrice цена которую нужно отформатировать
formattedPrice отформатировананя цена
*/
var roundedPrice = Math.round(layerPrice)
var formattedPrice = (roundedPrice + "").replace(/(\d)(?=(\d\d\d)+$)/, "$1 ")
@Burick
Burick / form2file.php
Last active January 20, 2017 14:15
выбирает записи из таблицы FormIt и записывает в csv
<?php
$index = $_SERVER[DOCUMENT_ROOT].'/index.php';
// Подключаем
define('MODX_API_MODE', true);
//require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/index.php';
require_once $index;
// Включаем обработку ошибок
$modx->getService('error','error.modError');
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
$modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML');