- Remove index on template name via: ALTER TABLE
modx3_site_templates
DROP INDEXtemplatename
- comment out 25-30 in /core/model/modx/processors/element/template/create.php
- comment out 40-46 in /core/model/modx/processors/element/template/update.php
This file contains 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 | |
$redirects = array( | |
'www.domain.com/old-url-1' => 'www.domain.com/new-url-1', | |
'www.domain.com/old-url-2' => 'www.domain.com/new-url-2', | |
); | |
$host = $_SERVER['HTTP_HOST']; | |
$url_parts = explode('?', $_SERVER['REQUEST_URI']); |
This file contains 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 | |
class AnyClassUsa { | |
public function render($template) | |
{ | |
$twig = $this->twig; | |
foreach(get_object_vars($this) as $property => $value) { | |
$params[$property] = $value; |
This file contains 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 | |
/* | |
curl -v -u API_TOKEN_HERE:api_token -X GET https://www.toggl.com/api/v6/me.json | |
curl -v -u API_TOKEN_HERE:api_token -X GET https://www.toggl.com/api/v6/time_entries.json | |
curl -v -u API_TOKEN_HERE:api_token -X GET "https://www.toggl.com/api/v6/time_entries.json?start_date=2010-02-05T15%3A42%3A46%2B02%3A00&end_date=2010-02-12T15%3A42%3A46%2B02%3A00" | |
*/ | |
$from_date = isset($_GET['from_date']) ? $_GET['from_date'] : date('m-d-Y'); | |
$to_date = isset($_GET['to_date']) ? $_GET['to_date'] : date('m-d-Y'); |
This file contains 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 | |
/** | |
* RPX Helper Class for JanRain Engage | |
* @author Andres Cordero | |
* @license MIT | |
* See http://www.opensource.org/licenses/mit-license.html | |
* if LICENSE file not present | |
* Make sure cURL is installed and allowed to initiate HTTPS connections | |
*/ |
This file contains 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 | |
if( !defined('VENDOR_PATH')) { | |
define('VENDOR_PATH', MODX_BASE_PATH.'/vendors'); | |
} | |
class RevoSnippet | |
{ | |
public function __construct() | |
{ |
This file contains 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 toggleFullScreen = false; | |
jQuery(document).ready(function($) { | |
$('#toggleButton').click(function() { | |
toggleFullScreen = true; | |
flowplayer.pause(); | |
toggleFullScreen = false; |
This file contains 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
Array | |
( | |
[0] => __construct | |
[1] => listGroups | |
[2] => getTemplateVarCollection | |
[3] => refreshURIs | |
[4] => process | |
[5] => getContent | |
[6] => setContent | |
[7] => getCacheKey |
This file contains 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 | |
function variable_name( &$var, $scope=false, $prefix='UNIQUE', $suffix='VARIABLE' ){ | |
if($scope) { | |
$vals = $scope; | |
} else { | |
$vals = $GLOBALS; | |
} | |
$old = $var; | |
$var = $new = $prefix.rand().$suffix; |