Skip to content

Instantly share code, notes, and snippets.

@larscwallin
larscwallin / README
Created January 23, 2012 12:09
SIMPLX UserManager
SIMPLX UserManager version 0.0.0.0.0.0.0.1
Helps you to get JSON encoded information from the MODx User related tables.
I use it to populate a TV dropdown with MODx users.
UPDATE 120123 13:17
Parameters:
@geddski
geddski / nesting.js
Created January 14, 2012 05:08
helper function for nesting backbone collections.
function nestCollection(model, attributeName, nestedCollection) {
//setup nested references
for (var i = 0; i < nestedCollection.length; i++) {
model.attributes[attributeName][i] = nestedCollection.at(i).attributes;
}
//create empty arrays if none
nestedCollection.bind('add', function (initiative) {
if (!model.get(attributeName)) {
model.attributes[attributeName] = [];
@mbbx6spp
mbbx6spp / README.md
Last active May 26, 2024 23:00
Retaining Git history of subdirectory from parent repository

Subdirectory Git Repository

This is a mini howto on moving a subdirectory to its own repository retaining history

Howto

Assume PARENT is the original parent Git repository (locally) and CHILD is the new local repository that you wish to create from a subdirectory, retaining all of its history from the PARENT repository; PARENT_PATH and CHILD_PATH are the paths to PARENT and CHILD respectively; SUBDIR is the relative path within the repository under extraction:

  1. git clone --no-hardlinks PARENT_PATH CHILD_PATH
  2. pushd CHILD_PATH
@rosstimson
rosstimson / modx-git-bootstrap.sh
Created December 20, 2011 18:01
Quickly Bootstrap MODX (Revo) from Git Repo
#!/bin/sh
# Request and read in db details from user
echo "Please enter your database hostname
(e.g. localhost) and press [ENTER]:"
read db_host
echo "Please enter your MODX database name and press [ENTER]:"
read db_name
echo "Please enter your MODX database user and press [ENTER]:"
read db_user
@bfncs
bfncs / defaultTemplateByParentTv.plugin.php
Created December 13, 2011 23:55
Default Children Template by Parent TV - modX Revolution Plugin
<?php
/**
* =========================
* defaultTemplateByParentTv
* =========================
*
* Plugin for modX Revolution
* Set default template for children of a ressource
*
* Author:
@mklabs
mklabs / bootstrap-plugins.txt
Created December 2, 2011 11:23
h5bp + twitter bootstrap integration
bootstrap-tooltip.js
bootstrap-popover.js
bootstrap-alert.js
bootstrap-button.js
bootstrap-carousel.js
bootstrap-collapse.js
bootstrap-dropdown.js
bootstrap-modal.js
bootstrap-scrollspy.js
bootstrap-tab.js
@hileon
hileon / gist:1311735
Created October 25, 2011 07:39 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Windows)

General

Ctrl+KB toggle side bar
Ctrl+Shift+P command prompt
Ctrl+` python console
Ctrl+N new file

Editing

@oksushi
oksushi / migx_modx-2.2.diff
Created October 6, 2011 04:43 — forked from mkschell/migx_modx-2.2.diff
MIGX diff for MODX2.2
--------------- core/components/migx/elements/tv/input/migx.php ---------------
index 11a9c2d..53370a5 100644
@@ -133,6 +133,7 @@ $lang = $this->xpdo->lexicon->fetch();
$lang['mig_add'] = !empty($properties['btntext'])?$properties['btntext']:$lang['mig_add'];
$modx->smarty->assign('i18n', $lang);
$this->xpdo->smarty->assign('properties', $properties);
+$this->xpdo->smarty->assign('resource', is_object($this->xpdo->resource) ? $this->xpdo->resource->toArray() : array());
$this->xpdo->smarty->assign('pathconfigs', $this->xpdo->toJSON($pathconfigs));
$this->xpdo->smarty->assign('columns', $this->xpdo->toJSON($cols));
$this->xpdo->smarty->assign('fields', $this->xpdo->toJSON($fields));
@opengeek
opengeek / plugin.RemoteCommands.php
Created October 4, 2011 14:48
RemoteCommands and SendClearCache plugins for MODX Revolution 2.2+
<?php
/* RemoteCommands plugin -- register with OnHandleRequest OR OnWebPageComplete event */
/* define the IP of the master instance which does not need to execute remote commands */
$master_instance = $modx->getOption('master_instance', $scriptProperties, '127.0.0.1');
/* get the instance IP */
$instance = $_SERVER['SERVER_ADDR'];
/* the number of seconds the remote command is valid for */
@splittingred
splittingred / install.sh
Created September 22, 2011 21:35
Bash script to install a new MODX Revolution 2.2+ install via CLI
Examples of above script:
# into a standard directory, where config.xml resides in the current working directory
sh install.sh /home/modx/public_html/
# with a custom config.xml file
sh install.sh /home/modx/public_html/ /opt/local/modx/config.xml