Skip to content

Instantly share code, notes, and snippets.

View elliotttf's full-sized avatar

Elliott Foster elliotttf

View GitHub Profile
164 === modified file 'drupal/sites/all/modules/ec_ads/ec_ads.module'
165 --- drupal/sites/all/modules/ec_ads/ec_ads.module 2011-04-12 18:08:43 +0000
166 +++ drupal/sites/all/modules/ec_ads/ec_ads.module 2011-04-21 14:56:47 +0000
167 @@ -394,6 +394,11 @@
168 $topic = menu_get_object('ec_topic');
169 $visible = is_object($topic);
170 break;
171 +
172 + case 'bottom_right_mpu_ad':
173 + // Hide bottom mpu on search page.
<?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) {
<!-- OLD -->
<!--/* You may give each page an identifying name, server, and channel onthe next lines. */
s.pageName="rss|home"
s.server="www.economist.com"
s.channel="rss"
s.prop1="rss|home"
s.prop2="indexpage|economist.com/rss"
s.prop3=""
s.prop4="index_page|economist.com/rss"
s.prop5=""
<?php
/**
* Implementation of hook_theme_registry_alter().
*/
function ec_rss_theme_registry_alter(&$theme_registry) {
$theme_registry['views_view_field__ec_rss__feed_2__title']['path'] = drupal_get_path('module', 'views') . '/theme';
$theme_registry['views_view_field__ec_rss__feed_2__title']['template'] = 'views-view-field';
$theme_registry['views_view_field__ec_rss__feed_2__title']['preprocess functions'][] = 'template_preprocess_views_view_field';
$theme_registry['views_view_field__ec_rss__feed_2__title']['preprocess functions'][] = 'ec_rss_preprocess_views_view_field__ec_rss__feed_2__title';
$theme_registry['views_view_field__ec_rss__feed_2__title']['arguments'] = array('view' => NULL, 'field' => NULL, 'row' => NULL);
app_root = "/home/elliott/www/presentations"
God.watch do |w|
w.name = "node-god-instances"
w.group = 'node-god'
w.interval = 5.seconds
w.start = "env node #{app_root}/server.js"
w.stop = "env killall node"
@elliotttf
elliotttf / gist:1102105
Created July 24, 2011 02:02
git branch on terminal prompt
# Add current git branch (if applicale) to the terminal prompt.
function pgb {
ref=$(/usr/bin/git symbolic-ref HEAD 2> /dev/null) || return
dirty=""
untracked=""
# Disallow unstaged changes in the working tree
if ! /usr/bin/git diff-files --quiet --ignore-submodules --
then
dirty="*"
@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';
@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 = '>';
"Enable filetype detection
:filetype on
"General settings
set background=dark "Dark background"
set fileformats=unix "Use Unix line endings
set smartindent "Smart autoindenting on new line
set smarttab "Respect space/tab settings
set history=300 "Number of commands to remember
set showmode "Show whether in Visual, Replace, or Insert Mode
<?php
$my_var = !empty($field) ? $field : "I'm empty, yo!";