Skip to content

Instantly share code, notes, and snippets.

View Fi1osof's full-sized avatar

Nikolay Lanets Fi1osof

View GitHub Profile
@Fi1osof
Fi1osof / wp_import.php
Last active February 10, 2023 18:51 — forked from zorgsoft/wp_import.php
<?php
/*
* WP Import, Ver 2015.01.04
* (C) 2015 by ZoRg Soft
* MODx Notes - WP Import модуь для импорта записей из Wordpress
* http://agarkov.org/modx-x/evo-wpimport
*/
$theme = $modx->config['manager_theme'];
$basePath = $modx->config['base_path'];
@Fi1osof
Fi1osof / machine.js
Last active June 10, 2022 08:12
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@Fi1osof
Fi1osof / react
Last active April 17, 2018 16:56 — forked from koras/react
react
// https://maxfarseer.gitbooks.io/react-course-ru/content/zhiznennii_tsikl_komponenta.html
// https://maxfarseer.gitbooks.io/react-course-ru/content/prodvinutoe_ispolzovanie.html
// https://reactjs.org/docs/faq-ajax.html
import React, { Component } from 'react';
import { Link } from "react-router-dom";
import { promisifyAll } from 'bluebird'
//import ReactDOM from 'react-dom';
import { getWeb3Async } from '../util/web3'
@Fi1osof
Fi1osof / gist:4583503
Created January 21, 2013 03:58
Свич процессоров в процессоре
<?php
class YleyCompaniesUsersGetListProcessor extends modProcessor{
public static function getInstance(modX &$modx,$className,$properties = array()) {
switch($properties['type']){
case 'company__':
$className = require_once dirname(__FILE__).'/users/getlist.class.php';
break;
@Fi1osof
Fi1osof / modcli.php
Created December 29, 2012 21:52 — forked from Mark-H/a readme.md
<?php
/**
* modCLI is a command line interface for MODX Revolution Processors.
*
* It enables you to run any core or third party processor from the command line, passing it options as you go along.
*
* @author Mark Hamstra <hello@markhamstra.com>
* @version 0.1.0-pl, 2012-12-16
* @license GPL v2
*/
<?php
class modSiteWebBreadcrumbsProcessor extends modProcessor{
public function initialize(){
$this->setDefaultProperties(array(
'startId' => 0,
'excludeDocs' => array(),
'showHidden' => true,
'showUnpub' => false,
@Fi1osof
Fi1osof / gist:6907324
Created October 9, 2013 19:58
Создаем таблицы и основные записи для пакета Billing
<?php
$manager = $modx->getManager();
// Создаем таблицы
$objects = array(
'Order',
'OrderProduct',
'OrderStatus',
@Fi1osof
Fi1osof / gist:6023918
Last active December 19, 2015 21:59
Дефолтовый контроллер
<?php
$properties = $modx->resource->getOne('Template')->getProperties();
if(!empty($properties['tpl'])){
$tpl = $properties['tpl'];
}
else{
$tpl = 'index.tpl';
}
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage PluginsFunction
*/
function smarty_function_processor($params, & $smarty)
@Fi1osof
Fi1osof / gist:5070120
Created March 2, 2013 08:00
ShopmodxObjectGetListProcessor
<?php
abstract class ShopmodxObjectGetListProcessor extends modObjectGetListProcessor{
function prepareQueryBeforeCount(xPDOQuery $c) {
$this->addDerivativeCriteria($c);
return parent::prepareQueryBeforeCount($c);
}
protected function addDerivativeCriteria(xPDOQuery $c){
$this->modx->addDerivativeCriteria($this->classKey, $c);