This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Скрипт надо запускать от юзера - владельца сайта, чтобы созданные файлы пакетов не принадлежали юзеру root | |
$ sudo -u USERNAME php /var/www/USERNAME/packages.php /var/www/USERNAME/www/ | |
Или от root, а после выставить владельца: | |
$ php /root/scripts/modx/packages.php /var/www/USERNAME/www/ && /var/www/USERNAME/chmod | |
Чтобы запустить из веба, просто положите скрипт в корень или куда-нибудь глубже и вызовите по HTTP | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = require('path'); | |
var fs = require('fs'); | |
var os = require('os'); | |
var express = require('express'); | |
var app = express(); | |
var Busboy = require('busboy'); | |
app.get('/', function (req, res) { | |
res.send('<html><head></head><body>\ | |
<form method="POST" enctype="multipart/form-data">\ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add RTE for introtext if richtext option is enabled for the resource | |
// check "OnDocFormRender" event | |
$modx->regClientStartupHTMLBlock('<script>Ext.onReady(function() { | |
if(MODx.loadRTE) MODx.loadRTE("modx-resource-introtext"); | |
});</script>'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$config = array( | |
'baseUrl' => rtrim('http://mywebsite.com/rest/api/','/'), | |
'format' => 'json', // json or xml, the format to request | |
'suppressSuffix' => false, // if false, will append .json or .xml to the URI requested | |
'username' => 'myuser', // if set, will use cURL auth to authenticate user | |
'password' => 'mypass', | |
'curlOptions' => array( | |
'timeout' => 30, // cURL timeout | |
'otherCurlOption' => 1, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void function() {//closure | |
var global = this | |
, _initKeyboardEvent_type = (function( e ) { | |
try { | |
e.initKeyboardEvent( | |
"keyup" // in DOMString typeArg | |
, false // in boolean canBubbleArg | |
, false // in boolean cancelableArg | |
, global // in views::AbstractView viewArg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"id":"4fede17c312f912796000034","cover_url":null,"description":null,"rating":6.3,"title":"L'affaire Gordji, histoire d'une cohabitation"},{"id":"4fede17f312f912796000035","cover_url":null,"description":"Documentary telling the true story of the sinking of the liner Laconia by a German U-boat in 1942 through the eyes of six survivors.","rating":6.8,"title":"Le naufrage du Laconia - partie 1"},{"id":"4fede181312f912796000036","cover_url":null,"description":"Documentary telling the true story of the sinking of the liner Laconia by a German U-boat in 1942 through the eyes of six survivors.","rating":6.8,"title":"Le naufrage du Laconia - partie 2"},{"id":"4fede184312f912796000037","cover_url":"http://ia.media-imdb.com/images/M/MV5BMjAyMTg0MjgwOV5BMl5BanBnXkFtZTcwNTEzODY4Mw@@._V1._SX94_SY140_.jpg","description":"The extraordinary story of three Rwandan kids who walk 3000 miles to the Soccer World Cup in South Africa...","rating":6.2,"title":"Africa United"},{"id":"4fede186312f912796000038","cover_url":"http://ia. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var flattenObject = function(ob) { | |
var toReturn = {}; | |
for (var i in ob) { | |
if (!ob.hasOwnProperty(i)) continue; | |
if ((typeof ob[i]) == 'object') { | |
var flatObject = flattenObject(ob[i]); | |
for (var x in flatObject) { | |
if (!flatObject.hasOwnProperty(x)) continue; |
NewerOlder