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 | |
require_once (dirname(dirname(__FILE__)).'/create.class.php'); | |
/** | |
* Creates a chunk. | |
* | |
* @param string $name The name of the chunk. | |
* @param string $description (optional) The description of the chunk. | |
* @param integer $category The category the chunk is assigned to. | |
* @param string $snippet The code of the chunk. | |
* @param boolean $locked Whether or not the chunk can only be accessed by |
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 | |
require_once (dirname(dirname(__FILE__)).'/create.class.php'); | |
/** | |
* Create a snippet. | |
* | |
* @param string $name The name of the element | |
* @param string $snippet The code of the snippet. | |
* @param string $description (optional) A brief description. | |
* @param integer $category (optional) The category to assign to. Defaults to no | |
* category. |
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 modElementCategoryUpdateProcessor extends modObjectUpdateProcessor { | |
public $classKey = 'modCategory'; | |
public $languageTopics = array('category'); | |
public $permission = 'save_category'; | |
public $objectType = 'category'; | |
} | |
return 'modElementCategoryUpdateProcessor'; |
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
------------------------------------------------------------------------------- | |
Language files blank comment code | |
------------------------------------------------------------------------------- | |
PHP 2218 24654 71713 180956 | |
Javascript 223 3906 5440 49419 | |
CSS 99 5030 1072 24588 | |
XML 16 469 303 2903 | |
Java 1 47 62 182 | |
SQL 4 20 37 120 | |
Smarty 3 5 0 58 |
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 | |
set_time_limit(0); | |
class Timer { | |
public $timer = 0; | |
public function start() { | |
$mtime = microtime(); | |
$mtime = explode(" ", $mtime); | |
$mtime = $mtime[1] + $mtime[0]; | |
$this->timer = $mtime; |
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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-s | |
RewriteRule ^(.*)$ rest/index.php?_rest=$1 [QSA,NC,L] | |
RewriteCond %{REQUEST_FILENAME} -d | |
RewriteRule ^(.*)$ rest/index.php [QSA,NC,L] | |
</IfModule> |
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
modx -2by2host -from:modx -from:modx_feeds -to:modx -from:wehatejbieber -modx_ch -mr_modx -/logs/modx -noon_modx lang:en |
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
$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 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
## | |
# Finds a normalized ranking of word frequency given an article of text | |
# | |
class Hash | |
## | |
# Normalize the array to values between 0 and 1 | |
# | |
# @param [Boolean] weight_lower_value Set to true to give more weight to lower values | |
# | |
def normalize(weight_lower_value = false) |