Skip to content

Instantly share code, notes, and snippets.

View alroniks's full-sized avatar

Ivan Klimchuk alroniks

View GitHub Profile
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Updated for MODx Revo by: Hansek http://www.modxcms.cz/ hansek@coex.cz
Created for MODx Evo by : Coroico (http://modx.wangba.fr)
Short Description: Language files checking tool for MODx Revolution
Version: 1.2
Created by: Coroico (http://modx.wangba.fr)

#Release 1.0.13 from 03.03.2014.

This release includes quite a few changes and improvements that would make simpler of creating sites on MODX EVO.

Fixes: 44
Refactoring: 42
Improvements: 24
Security: 1

##Main things, on that I would like to draw attention:

@alroniks
alroniks / .vimrc
Created March 10, 2014 12:19 — forked from JeffreyWay/.vimrc
set nocompatible " Disable vi-compatibility
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15
@alroniks
alroniks / extends
Last active August 29, 2015 14:08
extends
<?php
/*
* Nested templates in MODX Revolution
*
* Using: Make layout template and call it in other template as [[>layout]]
* Use [[@yield]] for determine block that will be replaced by child temlate
*
* Required OnParseDocument event
*
* @author Ivan Klimchuk <ivan@klimchuk.com>
@alroniks
alroniks / batchsubscriber.php
Created February 18, 2015 09:01
Batch Subscriber for Sendex
<?php
$modx->addPackage('sendex', MODX_CORE_PATH . 'components/sendex/model/');
$subscribers = array(
array('Фамилия Имя Отчество' , 'email@mail.ru'),
);
foreach ($subscribers as $s) {
if (!$u = $modx->getObject('modUserProfile', array('email' => $s[1]))) {
<div class="wrapper navigation">
<div class="container">
<div class="row navigation__first">
<div class="col-xs-12">
<nav class="menu-catalog">
<ul>
<li class="has-submenu has-catalog"><a href="#">Каталог</a></li>
<li><a href="{$_modx->makeUrl(1844)}">Бренды</a></li>
<li class="has-submenu"><a href="{$_modx->makeUrl($_modx->resource.id)}">Покупателю</a>
{$_modx->runSnippet('!pdoMenu', [
1
00:00:00,000 --> 00:00:23,042
alright everyone I do it so it's ok so
she asked me to talk at Larkin goes to
2
00:00:23,042 --> 00:00:28,064
the last year was obliged i enjoy to
throw out hope some of you that reappear
@alroniks
alroniks / gist:3436764
Created August 23, 2012 13:47
Price formatter
$string = '1000000000';
$array = preg_split('/(?<!^)(?!$)/u', $string);
$array = array_chunk(array_reverse($array), 3);
foreach($array as &$a){
$a = implode("", $a);
}
$result = implode(" ", array_reverse($array));
<?php
$from = "en";
$to = "ru";
$_lang = [];
$dir = "/home/ik/dev2/revolution/core/lexicon/" . $from;
$files = scandir($dir);
@alroniks
alroniks / maketree.php
Last active December 29, 2015 17:29
makeTree
<?php
function makeTree($list, $parent)
{
$tree = [];
foreach ($list as $item) {
if ($item['parent'] == $parent) {
$tree[$item['id']] = makeTree($list, $item['id']);
} else {
continue;
}