This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xsl:template name="break"> | |
<xsl:param name="text" select="."/> | |
<xsl:choose> | |
<xsl:when test="contains($text, '
')"> | |
<xsl:value-of select="substring-before($text, '
')"/> | |
<br/> | |
<xsl:call-template name="break"> | |
<xsl:with-param name="text" select="substring-after($text,'
')"/> | |
</xsl:call-template> | |
</xsl:when> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Magic quotes will end us all, so remove any quotes added by it | |
if (get_magic_quotes_gpc()) { | |
function _rss($v) { | |
$f = __FUNCTION__; | |
if (is_array($v)) { | |
foreach ($v as $k => $j) { | |
$v[$k] = $f($j); // yay recurssion! | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This script should be passed a GET parameter named "file" with the relative path | |
* to the .less file. | |
* | |
* If .css is used instead of .less, it will be replaced with .less when looking for | |
* the file. | |
* | |
* I personally use an internal redirect that matches the .css extension and rewrites |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implementation of hook_theme() | |
*/ | |
function module_theme($existing, $type, $theme, $path) { | |
$theme = array(); | |
$base = array( | |
'path' => "{$path}/theme", | |
'file' => 'theme.inc' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$result = mysql_query("SELECT * FROM content_field_hours LIMIT 1"); | |
while ($row = mysql_fetch_assoc($result)) { | |
var_dump($row); | |
} | |
/* Outputs | |
array(3) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>Fluid Resize Dimensions</title> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script> | |
<script type="text/javascript"> | |
$(function() { | |
$(window).bind('resize', function() { | |
$('div[class^="span-"]').each(function() { | |
var span = $(this).attr('class').replace(/span-/, ''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
/** | |
* `grep` is faster for single terms. | |
* | |
* `grep -i .php /path/to/access.log` | |
* | |
* vs. | |
* | |
* `this-script /path/to/access.log .php` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin | |
BDIR=/mnt/backup # Backup directory | |
TDIR=/var/trac # Trac directory | |
SDIR=/var/svn # SVN directory | |
MDIR=/var/lib/mysql # MySQL directory | |
HDIR=/home # Home directory | |
DATE=`date +%Y-%m-%d` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[20:00:08] Creating backup of Trac projects | |
[20:00:08] 10perimeterpark (656815) | |
[20:00:11] 2115piedmont (800928) | |
[20:00:12] aaps (1247372) | |
[20:00:13] acme (578997) | |
[20:00:14] acs (825498) | |
[20:00:15] acs-corporate (702622) | |
[20:00:16] afclients (2225320) | |
[20:00:17] ajff (6858629) | |
[20:00:18] alcan (787072) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use \lithium\security\Auth; | |
use \lithium\util\String; | |
Auth::config(array( | |
'account' => array( | |
'adapter' => 'Form', | |
'model' => 'Account', | |
'fields' => array('login'), |
OlderNewer