A ZSH theme optimized for people who use:
- Solarized
- Git
- Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)
For Mac users, I highly recommend iTerm 2 + Solarized Dark
[^qt^] - Query Time - Shows how long MODx took talking to the database <br> | |
[^q^] - Query Count -Shows how many database queries MODx made <br> | |
[^p^] - Parse Time - Shows how long MODx took to parse the page <br> | |
[^t^] - Total Time - Shows the total time taken to parse/ render the page <br> | |
[^s^] - Source - Shows the source of page, whether is database or cache. |
Snippet: [[SnippetName]] | |
Chunk: [[$ChunkName]] | |
System Setting: [[++SettingName]] | |
TV: [[*fieldName/TvName]] | |
Link tag: [[~PageId? ¶mName=`value`]] | |
Placeholder: [[+PlaceholderName]] | |
<?php |
<?php | |
// Use this line to prevent people from hammering your server. | |
if (!isset($_GET['super_secret']) || ($_GET['super_secret'] != 'secretpassword')) return 'Not authorized'; | |
// Call this snippet uncached in a resource with template "empty": | |
// content: "[[!benchmark]]" | |
// Make sure to tag the resource as uncachable | |
// The intro | |
echo '<body style="font-family: sans-serif;">'; |
modCLI is a wrapper for the MODX Revolution Processors, allowing you to pretty much do anything from the commandline that you would normally do within the manager.
To use modCLI, simply download the modcli.php file and put it in the MODX_BASE_PATH of your installation. Next open up the console or terminal, and start firing some commands at it.
(function($) { | |
$('a[href*=#]:not([href=#])').click(function() | |
{ | |
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') | |
|| location.hostname == this.hostname) | |
{ | |
var target = $(this.hash), | |
headerHeight = $(".primary-header").height() + 5; // Get fixed header height | |
The following shows what to watch out for when making Angular Dart applications. For more information about Angular Dart, see angulardart.org.
let map = new Map(); | |
map.set("a", 1); | |
map.set("b", 2); | |
map.set("c", 3); | |
let obj = Array.from(map).reduce((obj, [key, value]) => ( | |
Object.assign(obj, { [key]: value }) // Be careful! Maps can have non-String keys; object literals can't. | |
), {}); | |
console.log(obj); // => { a: 1, b: 2, c: 3 } |