Skip to content

Instantly share code, notes, and snippets.

View sirlancelot's full-sized avatar
🍕
Is life without pizza really living?

Matthew Pietz sirlancelot

🍕
Is life without pizza really living?
View GitHub Profile
@sirlancelot
sirlancelot / attach-disk-image.sh
Created January 25, 2010 23:13
Script that can be used during Mac OS X startup to mount a disk image to any path on the filesystem.
#!/bin/sh
##
# Mount my development websites folder
#
# NOTE: Because this uses Mac OS X mounting techniques, all mac format
# images are supported and many other UNIX filesystem formats.
# (My Development Sites image is stored encrypted.)
# Location of the image to be mounted
IMAGE="$HOME/Documents/Development Sites.sparsebundle"
<?php
function GetDocumentData() {
$Database = $this->modx->db;
$DocIDs = $this->modx->getChildIds($this->Configuration['StartID'], $this->Configuration['Level']);
$Select = array(
'ID' => 'sc.id',
'Parent' => 'sc.parent',
'Hidden' => 'sc.hidemenu',
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- Properly base URLs so they work -->
<xsl:template name="GetUrl" match="@href | @src" mode="html">
<xsl:param name="Url" select="." />
<xsl:variable name="AbsoluteUrl">
<xsl:choose>
<xsl:when test="contains($Url,'://') or starts-with($Url,'/')"><xsl:value-of select="$Url" /></xsl:when>
<xsl:when test="starts-with($Url,'~/')"><xsl:value-of select="concat($root,substring($Url,1))" /></xsl:when>
@sirlancelot
sirlancelot / date-utility_RFC-to-ISO.xsl
Created April 8, 2009 21:34 — forked from bzerangue/date-utility_RFC-to-ISO.xsl
made template match 'pubDate' so it can be called by 'apply-templates', removed redundant substring()s
<?xml version="1.0" encoding="UTF-8" ?>
<!--
XSL Utility for Symphony 2
Convert RSS feed date format to Symphony date format
Convert RFC 2822 timestamp format to ISO date format minus the time info (Symphony CMS date format)
RFC 2822 format: Sun, 7 Jan 2007 12:00:00 GMT
ISO 8601 format (minus the time info): 2007-01-07
-->
<xsl:stylesheet version="1.0"