Skip to content

Instantly share code, notes, and snippets.

View Kookabura's full-sized avatar
🎯
Focusing

Anatoly Seregin Kookabura

🎯
Focusing
View GitHub Profile
@Kookabura
Kookabura / vkontakte.php
Created July 25, 2022 20:45
Исправление ошибки авторизации через VK для 1C-Bitrix, когда в backurl и redirect_url приходит & закодированный в html код & public_html/bitrix/modules/socialservices/classes/general/vkontakte.php
<?
IncludeModuleLangFile(__FILE__);
class CSocServVKontakte extends CSocServAuth
{
const ID = "VKontakte";
const CONTROLLER_URL = "https://www.bitrix24.ru/controller";
protected $entityOAuth = NULL;
parse_value () {
local jpath="${1:+$1,}$2" isleaf=0 isempty=0 print=0
case "$token" in
'{') parse_object "$jpath" ;;
'[') parse_array "$jpath" ;;
# At this point, the only valid single-character tokens are digits.
''|[!0-9]) throw "EXPECTED value GOT ${token:-EOF}" ;;
*) value=$token
isleaf=1
[ "$value" = '""' ] && isempty=1
"use strict";
function _defineProperty(e, t, a) {
return t in e ? Object.defineProperty(e, t, {
value: a,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = a, e
}
curl -X PUT "localhost:9200/products/?pretty" -H 'Content-Type: application/json' -d'
{
"settings": {
"analysis": {
"analyzer": {
"analyzer_keyword": {
"type": "custom",
"tokenizer": "keyword",
"filter": [
"lowercase"
@Kookabura
Kookabura / trello.js
Created August 26, 2019 08:43
trello.js for toggl button. Для подстановки номера карточки в тогл
! function(e) {
var t = {};
function r(n) {
if (t[n]) return t[n].exports;
var o = t[n] = {
i: n,
l: !1,
exports: {}
};
<?php
$q = $modx->newQuery('modContext');
$q->where(array(
'key:NOT IN' => array('mgr','spec')
));
$contexts = $modx->getCollection('modContext', $q);
foreach($contexts as $cx) {
$modx->log(1, $cx->get('key'));
@Kookabura
Kookabura / .gitignore
Created March 25, 2018 14:12
MODX gitignore
public_html/manager/
public_html/img/
error_log*
*.jpg
*.jpeg
*.png
public_html/assets/downloads/
public_html/assets/files/
public_html/assets/images/
core/cache/
@Kookabura
Kookabura / .gitify
Created March 25, 2018 12:25
Gitify example
data_directory: ../_data/
backup_directory: ../_backup/
data:
template_variables:
class: modTemplateVar
primary: name
template_variables_access:
class: modTemplateVarTemplate
primary:
- tmplvarid
@Kookabura
Kookabura / msearch2.class.php
Created November 2, 2017 11:14
Rewrote getFilters for better cache handling
<?php
/**
* Return array with filters
*
* @param array|string $ids
* @param boolean $build
*
* @return array|boolean
*/
public function getFilters($ids, $build = true) {
@Kookabura
Kookabura / countChildren.php
Last active October 25, 2017 21:28
Исправленная версия sfMenu при правилах по нескольким полям
<?php
public function countChildren($links = array()) {
$tree = array();
$time = microtime(true);
foreach ($links as $link) {
$total = 0;
$addTVs = $fields_where = $innerJoin = array();
foreach ($link['words'] as $field) {
switch ($field['class']) {