Skip to content

Instantly share code, notes, and snippets.

@Mark-H
Mark-H / 0_reuse_code.js
Created February 3, 2014 14:19
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Mark-H
Mark-H / gist:3494789
Created August 28, 2012 03:49 — forked from amdbuilder/gist:3494701
Busted
<?php
$eventName = $modx->event->name;
switch ($eventName) {
case 'OnLoadWebDocument' :
$output = $GLOBALS['code_content'] = $modx->resource->get('content');
preg_match_all('/<pre.*?>(.*?)<\/pre>/ims', $output, $matches);
$i = 0;
$GLOBALS['code_matches'] = array();
foreach ($matches[1] as $key => $match) {
@Mark-H
Mark-H / simplx_toplaceholders.php
Created June 23, 2011 09:56 — forked from larscwallin/simplx_toplaceholders.php
MODx toPlaceholders wrapper
<?php
/*
Snippet "simplx_toplaceholders"
KISS Snippet which wraps the $modx equivalent, only adds the ability to use JSON input.
Example: