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 | |
// Here is a sample of the URLs this regex matches: (there can be more content after the given URL that will be ignored) | |
// http://youtu.be/dQw4w9WgXcQ | |
// http://www.youtube.com/embed/dQw4w9WgXcQ | |
// http://www.youtube.com/watch?v=dQw4w9WgXcQ | |
// http://www.youtube.com/?v=dQw4w9WgXcQ | |
// http://www.youtube.com/v/dQw4w9WgXcQ | |
// http://www.youtube.com/e/dQw4w9WgXcQ | |
// http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcQ |
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 | |
$docs = $modx->getCollection('modDocument'); | |
$pattern = '/www.xxx.com/(\d+)/'; | |
$replacement = '[[~$1]]'; | |
$count = 0; | |
foreach ($docs as $doc) { | |
$content = $doc->getContent(); | |
$hash1 = sha1($content); |
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
@mixin breakpoint($point) | |
@if $point == lg | |
@media (min-width: 1200px) | |
@content | |
@else if $point == md | |
@media (min-width: 992px) and (max-width: 1199px) | |
@content | |
@else if $point == sm |
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 | |
/** | |
* SessionManager | |
* A script that can be used for easy control over your session variables. | |
* Put this script in your core/components/ folder, inside a sessionman/ subdirectory. | |
* | |
* Load this one in your snippets/plugins like; | |
* | |
* $sessman = $modx->getService('session','SessionManager', $modx->getOption('sessman.core_path',null,$modx->getOption('core_path').'components/sessionman/'), $scriptProperties); | |
* if(!($sessman instanceof SessionManager)) { $modx->log(modX::LOG_LEVEL_ERROR, 'Session manager could not be loaded..'); return ''; } |