Skip to content

Instantly share code, notes, and snippets.

View elliotttf's full-sized avatar

Elliott Foster elliotttf

View GitHub Profile
@elliotttf
elliotttf / cli.php
Created August 29, 2011 20:33 — forked from pifantastic/cli.php
PHP Progress bar
<?php
class cli {
public static $pb_length = 50;
public static $pb_start = '[';
public static $pb_end = ']';
public static $pb_bg = ' ';
public static $pb_fg = '=';
public static $pb_head = '>';
@elliotttf
elliotttf / settings.php
Created August 22, 2011 15:09 — forked from rupl/settings.php
Allows regular drush commands without -l arg when using super awesome dynamic vhost
<?php
/**
* Allow developers to override settings.
*/
define('SWEET_ASS_LIVE_SETTINGS_REGEX', '/^(.*)drupalcampaustin.org(:\d+)*$/');
define('SWEET_ASS_STAGE_SETTINGS_REGEX', '/^(dca11\.webchefs\.org|dca11\.dev1\.fourkitchens\.com)(:\d+)*$/');
if (preg_match(SWEET_ASS_LIVE_SETTINGS_REGEX, $_SERVER['HTTP_HOST'], $matches)) {
if (file_exists('sites/default/settings.live.php')) {
include_once 'sites/default/settings.live.php';
<?php
function ec_dreammail_escape_xml($string) {
return htmlentities($string, ENT_QUOTES, 'UTF-8');
}
/**
* Returns FALSE if there are unsafe characters.
*/
function ec_dreammail_sanitize_xml($string) {