Skip to content

Instantly share code, notes, and snippets.

@alanpich
alanpich / Usage.modx.html
Last active December 15, 2015 04:39
Include a MODX static resource as a script tag in a document
<html>
<head>
...
[[~123:javascript]]
[[~321:stylesheet]]
</head>
</html>
@alanpich
alanpich / jquery.temporaryCss.js
Created March 7, 2013 20:17
jQuery plugin to that allows styles to be set temporarily to an element, and will revert to their previous state after an allotted time or when a specified event is triggered on the element
/**
* jQuery plugin that allows styles to be set temporarily
* to an element, and will revert to their previous state
* after an allotted time or when a specified event is triggered
*
* @author Alan Pich <[email protected]>
*
* @param {Object} styles
* @param {String|Number} timeOrEvent
*/
@alanpich
alanpich / ModxWrapper.php
Created March 4, 2013 14:06
Wrapper class for loading a MODx instance from a specific path on disk and interacting with it
<?php
namespace AlanPich\Tools;
class ModxWrapper
{
/** @var \modX */
protected $modx;
/** @var string */
<?php
namespace OS\ConMan;
use \Slim\Extras\Views\Twig;
class ConMan {
protected $slim;
protected $view;
@alanpich
alanpich / pmsPackageInterface.php
Created November 28, 2012 20:41
pmsPackage Interface
<?php
/**
* Interface definition for pms packages
*
* @package pms
* @author Alan Pich <[email protected]>
* @copyright (c) 2013, Alan Pich
* @date 28-Nov-2012
*/
@alanpich
alanpich / modMigrate.php
Created November 28, 2012 10:11
modMigrate ideas
<?php
abstract class modMigrateObject {
/* @var object Object Properties */
private $data;
/* @var string MODx Class Name */
private $classKey;
@alanpich
alanpich / slimcontrollers.php
Created November 2, 2012 17:30
filesystem controller w/ Slim
<?php
header('Content-Type: text/plain');
define('ROOT',dirname(dirname(__FILE__)).'/');
define('CONTROLLER_PATH',ROOT.'controllers/');
/**
* Initialize some Slim action
*/
require ROOT.'lib/Slim/Slim/Slim.php';
@alanpich
alanpich / slim1.php
Created November 2, 2012 17:15
SlimPHP optional path params
/*@var $controllers Array of String */
/**
* Set up Slim listeners for each controller
*/
foreach($controllers as $C){
// Map GET
$slim->get("/$C/:id/:relation",function($id,$relation){
print_r(array(