Skip to content

Instantly share code, notes, and snippets.

View Ibochkarev's full-sized avatar
🏠
Working from home

Bochkarev Ivan Ibochkarev

🏠
Working from home
View GitHub Profile
@Ibochkarev
Ibochkarev / common.js
Created March 11, 2016 10:24
scrollCurrentLink
$(document).ready(function () {
$(document).on("scroll", onScroll);
//smoothscroll
$('a[href^="#"]').on('click', function (e) {
e.preventDefault();
$(document).off("scroll");
$('a').each(function () {
$(this).removeClass('active');
@Ibochkarev
Ibochkarev / Вывод количества товаров в категории.php Вывод количества товаров в категории minishop2 Сниппет получает сумму всех товаров в категории, с учетом мультикатегорий MS2. Можно указать нужную категорию параметром $parent.
<?php
if (empty($parent)) {$parent = $modx->resource->id;}
$pids = array_merge(array($parent), $modx->getChildIds($parent));
$ids = array();
$q = $modx->newQuery('msProduct');
$q->where(array('class_key' => 'msProduct','parent:IN' => $pids,'published' => 1,'deleted' => 0));
$q->select('`msProduct`.`id`');
if ($q->prepare() && $q->stmt->execute()) {
$ids = $q->stmt->fetchAll(PDO::FETCH_COLUMN);
@Ibochkarev
Ibochkarev / recent.php
Created October 21, 2016 10:40 — forked from andronex/recent.php
Вывод последних просмотренных товаров
<?php
$id = $modx->resource->id;
if (!isset($limit)) {$limit = 4;}
// Добавляем просмотренный товар MS2 в сессию
if ($modx->resource->get('class_key') == 'msProduct') {
if (!isset($_SESSION['viewedrecent'])) {
$_SESSION['viewedrecent'] = array($id);
}
else {
@Ibochkarev
Ibochkarev / bootstrap-masonry-template.htm
Created October 26, 2016 01:10 — forked from justincarroll/bootstrap-masonry-template.htm
This is my template for using Masonry 3 with Bootstrap 3. For those of you who follow this gist a lot has changed since Bootstrap 2.
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap Masonry Template</title>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans+Caption:400,700">
@Ibochkarev
Ibochkarev / advancedsettings.xml
Created February 18, 2017 02:58 — forked from SimpleHomelab/advancedsettings.xml
AdvacedSettings.xml for Kodi with MySQL and other tweaks.
<!-- General Settings -->
<advancedsettings>
<loglevel hide="true">-1</loglevel> <!-- Comment: Disables logging -->
<playcountminimumpercent>95</playcountminimumpercent>
<skiploopfilter>0</skiploopfilter> <!-- Comment: For RPi or similar use 16 or higher (low CPU usage) -->
<nodvdrom>true</nodvdrom>
<!-- MySQL Library -->
<videodatabase>
<type>mysql</type>
@Ibochkarev
Ibochkarev / iterm2-solarized.md
Created April 9, 2017 11:20 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

Keymap (Windows Users):
[
{ "keys": ["alt+shift+f"], "command": "reindent" },
]
Settings:
{
"show_definitions": false,
"auto_complete": false,
"bold_folder_labels": true,
var groups = [{
name: "Азов",
style: "kino#customPoint",
items: [{
[[pdoResources?
&parents=`217`
&depth=`2`
&limit=`0`
&tpl=`geoObject_group`
&outputSeparator=`},
center: [[[+tv.geo_shop]]],
name: "[[+pagetitle]]",
address: "[[+tv.address_shop]]",
tc_shop: "[[+tv.tc_shop]]",
geo_accuracy: "house",
state: "[[+tv.state_shop:is=`0`:then=`[[+tv.state_shop]]`:else=`&mdash;`]]",
city: "[[+tv.city_shop]]"
{if $idx == 2}
<div class="maxus-news__item post pull-left" data-news-type="part">
<header class="entry-header maxus-news__img">
<a href="[[~[[+id]]]]" title="[[+pagetitle]]">
<img src="[[+medium]]" alt="[[+pagetitle]]">
<span class="maxus-news__overlay" data-color-class="white"></span>
</a>
</header>
<!-- /.entry-header -->