Skip to content

Instantly share code, notes, and snippets.

@vgrish
vgrish / chmod
Last active August 29, 2015 13:56
echo "Set permissions for /mag2.promoway1.ru/www...";
echo "CHOWN files...";
chown -R u19587:u19587 "/mag2.promoway1.ru/www";
echo "CHMOD directories...";
find "/mag2.promoway1.ru/www" -type d -exec chmod 0755 '{}' \;
echo "CHMOD files...";
find "/mag2.promoway1.ru/www" -type f -exec chmod 0644 '{}' \;
@vgrish
vgrish / getnodes.class.php
Created March 4, 2014 09:12
core/model/modx/processors/resource/getnodes.class.php
<?php
/**
* Get nodes for the resource tree
*
* @package modx
* @subpackage processors.layout.tree.resource
*/
class modResourceGetNodesProcessor extends modProcessor {
/** @var int $defaultRootId */
public $defaultRootId;
<h2>первый вызов</h2>
[[!AjaxSnippet?
&snippet=`pdoPage`
&element=`msProducts`
&tpl=`tpl.msProducts.row`
&limit=`3`
&depth=`1`
&parents=`4`
&showLog=`0`
@vgrish
vgrish / Hash.js
Created March 14, 2014 15:51
history api
Hash = {
// Получаем данные из адреса
get: function() {
var vars = {}, hash, splitter, hashes;
if (!this.oldbrowser()) {
var pos = window.location.href.indexOf('?');
hashes = (pos != -1) ? decodeURIComponent(window.location.href.substr(pos + 1)) : '';
splitter = '&';
}
else {
#!/bin/bash
echo "Set permissions for /var/www/photo-angel.kz/www...";
echo "CHOWN files...";
chown -R photo-angel:photo-angel "/var/www/photo-angel.kz/www";
echo "CHMOD directories...";
find "/var/www/photo-angel.kz/www" -type d -exec chmod 0755 '{}' \;
echo "CHMOD files...";
find "/var/www/photo-angel.kz/www" -type f -exec chmod 0644 '{}' \;
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>вход</title>
</head>
<body>
<p>php не пашет</p>
</body>
</html>
[2014-04-17 17:43:10] (ERROR @ /assets/components/msklad/1c_exchange.php) [mSklad] Ошибка загрузки изображения товара (Кроссовки EXIT 2 GTX Salomon 41189), файл (/home/v/vertical23/public_html/assets/components/msklad/1c_temp/1682dd8e2b1111e18aece06995c938e0_2b6e8a0b698411e384d2e06995c938e0.jpg) не найден
[2014-04-17 17:43:10] (ERROR @ /assets/components/msklad/1c_exchange.php) [mSklad] Ошибка загрузки изображения товара (Кроссовки EXIT 2 GTX W Salomon 41190), файл (/home/v/vertical23/public_html/assets/components/msklad/1c_temp/1682dd952b1111e18aece06995c938e0_2b6e8a0c698411e384d2e06995c938e0.jpg) не найден
[2014-04-17 17:43:10] (ERROR @ /assets/components/msklad/1c_exchange.php) [mSklad] Ошибка загрузки изображения товара (Кроссовки EXIT 2 PEAK Salomon 41191), файл (/home/v/vertical23/public_html/assets/components/msklad/1c_temp/1682dd9d2b1111e18aece06995c938e0_2b6e8a0d698411e384d2e06995c938e0.jpg) не найден
[2014-04-17 17:43:10] (ERROR @ /assets/components/msklad/1c_exchange.php) [mSklad] Ошибка загруз
@vgrish
vgrish / memcache.php
Created April 22, 2014 05:17
мониторинг memcache
<?php
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2004 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
Crossposting.panel.Send = function(config) {
config = config || {record:{}};
config.record = config.record || {};
Ext.applyIf(config,{
//extend: MODx.panel.Resource,
baseParams: {}
,panelXType: 'crossposting-panel-send'
,border: false
//,cls: 'modx-resource-tab'
,layout: 'form'
@vgrish
vgrish / gist:3316f0d2135e505bcf7f
Created August 6, 2014 17:26
обновление цен и остатка по крону
<?php
define('MODX_API_MODE', true);
require_once '../index.php'; // подключаем index.php
$modx->getService('error','error.modError');
$modx->getRequest();
$modx->setLogLevel(modX::LOG_LEVEL_ERROR);
$modx->setLogTarget('FILE');
$modx->error->message = null;