I hereby claim:
- I am matdave on github.
- I am matjones (https://keybase.io/matjones) on keybase.
- I have a public key whose fingerprint is 844B 38BB 2C5A 974B 5667 F125 3AED 15C3 A370 EE19
To claim this, I am signing this object:
<?php | |
switch ($modx->event->name) { | |
case 'OnBeforeDocFormSave': | |
$now = mktime(); | |
$lastcache = $modx->cacheManager->get('delaycache'); | |
if(!empty($lastcache) && ($now - $lastcache) < 300){ | |
$_POST['syncsite'] = 0; | |
} | |
return; | |
break; |
#list of trusted IPs | |
set_real_ip_from 69.16.133.0/24 | |
set_real_ip_from 69.16.176.0/20 | |
set_real_ip_from 69.16.182.0/24 | |
set_real_ip_from 69.16.184.0/24 | |
set_real_ip_from 69.16.188.0/24 | |
set_real_ip_from 74.209.134.0/24 | |
set_real_ip_from 74.209.134.128/25 | |
set_real_ip_from 81.171.60.0/24 | |
set_real_ip_from 81.171.61.0/24 |
<?php | |
/** | |
* Warning: this code is for demonstration purposes only | |
*/ | |
if (!preg_match("/\.pdf$/", $input)) { | |
return "PDF file not specified."; | |
} | |
$options = explode('&', $modx->getOption('options', $scriptProperties, null)); | |
if(empty($options)){ |
[ | |
{"caption":"Image", "fields":[ | |
{"field":"image","caption":"Image","inputTVtype":"image"} | |
]}, | |
{"caption":"Info", "fields": [ | |
{"field":"title","caption":"Title"}, | |
{"field":"description","caption":"Description","inputTVtype":"richtext"} | |
]} | |
] |
<?php | |
/** | |
** OnPageNotFound | |
**/ | |
$URI = $_SERVER['REQUEST_URI']; | |
if(strpos($URI, '.html') !== false){ | |
$URI = ltrim(str_replace('.html','/',$URI), '/'); | |
$resource = $modx->getObject('modResource', array('uri:='=>$URI, 'context_key:='=> $modx->context->key)); |
<?php | |
ini_set('max_execution_time', 72000); | |
ini_set('memory_limit', '2048M'); | |
define('MODX_CORE_PATH', '/home/www/core/'); | |
require_once MODX_CORE_PATH . 'model/modx/modx.class.php'; | |
if(!function_exists('csv2array')){ | |
function csv2array($filename = '', $delimiter = ',', $asHash = true) | |
{ |
<?php | |
function filesModifiedSince($dir = "/", $modified = 0, $exclude = array()) { | |
$result = array(); | |
$exclude = array_merge(array(".",".."), $exclude); | |
$limit = time() - $modified; | |
$cdir = scandir($dir); | |
foreach ($cdir as $key => $value) | |
{ | |
if (!in_array($value,$exclude)) |
I hereby claim:
To claim this, I am signing this object:
<?php | |
function fixJSON($array, $mediaSources) { | |
$fix = array(); | |
foreach( $array as $key => $value) { | |
if (is_array($value)) { | |
$fix[$key] = fixJSON($value); | |
} else{ | |
if(in_array($key, array('mediaSource','imageMediaSource')){ | |
if(!empty($mediaSources[$value])){ | |
$value = $mediaSources[$value]; |