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
{ | |
"pages->find(\"selector\")": { | |
"prefix": "pages find(\"selector\")", | |
"body": [ | |
"\\$${1:pages}->find(\"${2:selector}\");" | |
], | |
"description": "Find and return all pages matching the given selector string. Returns a filtered PageArray unless an include mode is specified." | |
}, | |
"pages->count(\"selector\")": { | |
"prefix": "pages count(\"selector\")", |
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 MyGetListProcessor extends modObjectGetProcessor { | |
public $classKey = 'className'; | |
public function process() { | |
$data = array(); | |
$settings = array( | |
'emailsender' => $this->modx->getOption('emailsender') | |
); | |
$data['total'] = count($settings); |
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 | |
/* LangRouter | |
* ========== | |
* | |
* This plugin is meant to be used with Babel extra for MODX Revolution. It | |
* takes care of switching contexts, which hold translations, depending on URL | |
* requested by client. LangRouter works with so called subfolder based setup, | |
* in which many languages are served under a single domain but are | |
* differentiated by a virtual subfolder indicating the language, eg. | |
* mydomain.com/pl/. |
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 | |
/* | |
* A small MODX snippet to extract POST, GET, SESSION & COOKIE values - (c) 2012-2016 ackwa.fr | |
* | |
* @version : 1.0.4 | |
* @see : https://gist.github.com/gists/2853625 | |
* @name : argv.php | |
* @author : [email protected] | |
* @usage : [[!argv?key=`myparam`&default=`1`]] -> return the value | |
* [[!argv?key=`myparam`&default=`1`&toph=`1`]] -> set [[+argv.myparam]] |
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
Snippet: [[SnippetName]] | |
Chunk: [[$ChunkName]] | |
System Setting: [[++SettingName]] | |
TV: [[*fieldName/TvName]] | |
Link tag: [[~PageId? ¶mName=`value`]] | |
Placeholder: [[+PlaceholderName]] | |
<?php |
Read Damon Muma on this. He proposes the following jQuery solution (inspired by Thompson, fixed by me):
// Apply focus properly when accessing internal links with keyboard in WebKit browsers.
$("a[href^='#']").not("a[href='#']").click(function() {
$("#"+$(this).attr("href").slice(1)+"").focus();
});
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
find . -name '*.mp3' -print0 | xargs -0 -I {} sh -c 'echo "{}"; n="{}~"; cp "{}" "$n"; id3v2 -D "$n"; cat "$n" >> comb.mp3; rm "$n"'; ffmpeg -i comb.mp3 -acodec libfaac audiobook.m4a; mv audiobook.m4a audiobook.m4b |