Skip to content

Instantly share code, notes, and snippets.

View dayAlone's full-sized avatar

Andrey Kolmakov dayAlone

View GitHub Profile

Часто используемые алгоритмы в 1С-Битрикс

Подключение модуля

<?
	CModule::IncludeModule("iblock");
?>

Сортировка по описанию

##Меню

<?php
	$APPLICATION->IncludeComponent("bitrix:menu", "", 
    array(
        "ALLOW_MULTI_SELECT" => "Y",
        "MENU_CACHE_TYPE"    => "A",
        "CHILD_MENU_TYPE"    => "left",
        "ROOT_MENU_TYPE"     => "top",
        "MAX_LEVEL"          => "2",
@dayAlone
dayAlone / plugins.json
Last active August 29, 2015 14:24
Build
{
"bem":{
"js":"/jquery.bem/jquery.bem.js"
},
"bgcheck":{
"js":"/bgcheck/background-check.js"
},
"blurjs":{
"js":"/blurjs/blur.js"
},
<?php
if (ini_get('short_open_tag') == 0)
die('Error: short_open_tag parameter must be turned on in php.ini');
?><?
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT);
if (getenv('BITRIX_VA_VER'))
define('VMBITRIX', 'defined');
if (version_compare(phpversion(),'5.3.0','<'))
@dayAlone
dayAlone / my
Created October 16, 2015 00:08
/*
// Import categories
$.get('http://ru.russellhobbs.com/russell-hobbs-products/', (data) => {
$(data).find('#dsnestCat li').each((key, el)=> {
let $el = $(el);
let $img = $el.find('img');
if ($img) {
//https://www.headspace.com/ajax?resource=/pack/all
const co = require('co')
const parallel = require('co-parallel')
const download = require('download')
const fetch = require('node-fetch')
const fs = require('fs')
const token = 'DJt2PcGT_vh7UAiX_1KeCxsPXhF7Aj79yc2fFdAoL1k'
console.table($('#testform fieldset').map((key, el) => {
const parent = `#testform .testvoprosblock > div:nth-of-type(${key+1})`
const right = parseInt($(`${parent} input[value="2"]`)[0].getAttribute('valuez'), 10) + 1
const result = {
title: $(`${parent} .testvopros`)[0].innerHTML,
right: $(`${parent} .stylezed:nth-of-type(${right}) label`)[0].innerHTML,
}
return result
}).toArray())
@dayAlone
dayAlone / 1.js
Last active February 8, 2017 01:11
skyeng
['.b-vc-workplace-orderWord__holder'].map(selector =>
$(selector).toArray().map((el, key) => ({
right: $(selector + ':nth-child(' + (key + 1) + ') .b-vc-workplace-orderWord').toArray().map(el => Object.values(JSON.parse(el.getAttribute('drag-and-drop-order').match(/rightOrder:(.*) \}/)[1])).map(el => $$('[data-hash="' + el + '"] span')[1].innerText))[0],
answers: $(selector + ':nth-child(' + (key + 1) + ') .b-vc-workplace-orderWord__item span')
.toArray()
.map(el => el.innerText)
.filter(el => el.length > 0)
})))[0]
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to make opened Markdown files always be soft wrapped:
#
# path = require 'path'
#
@dayAlone
dayAlone / counters.html
Last active May 26, 2019 01:42
counters
<!-- Yandex.Metrika global start - do not remove!!! -->
<script type="text/javascript">
(function(d, w, c) {
(w[c] = w[c] || []).push(function() {
try {
w.yaCounter3791698 = w.yaCounter3791698 = new Ya.Metrika({
id: 3791698,
webvisor: true,
clickmap: true,
trackLinks: true,