Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bdombro
bdombro / gist:7439987
Last active December 28, 2015 04:09
Alias question for frank
<?php
$params = array(
'body' => $reach->img_shortcodes . $reach->description . "\n\n" .
$reach->shuttledetails . "\n\n" . $reach->gaugeinfo,
'fields' => array(
'legacy_id' => array(
'type' => 'text',
'value' => array(
$reach->reach_id,
),
#!/bin/sh
cd /var/www/mcua-dev
mysqldump mcua_civicrm > dumps/prod.mcua_civicrm.dump.sql
cat dumps/prod.mcua_civicrm.dump.sql | mysql mcuadev_civicrm
rsync -rv --delete-after /var/www/mcua/htdocs/sites/all/modules/civicrm/ htdocs/sites/all/modules/civicrm
rsync -rv --delete-after /var/www/mcua/htdocs/sites/default/files/civicrm/ htdocs/sites/default/files/civicrm
@bdombro
bdombro / php_rss_feed.php
Created April 18, 2014 17:12
PHP RSS Feed
<?php
$rss = new DOMDocument();
$rss->load('http://www.newsfromota.com/category/ota-members/government-affairs-policy/feed/');
$feed = array();
foreach ($rss->getElementsByTagName('item') as $node) {
$item = array (
'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,
'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue,
'link' => $node->getElementsByTagName('link')->item(0)->nodeValue,
'date' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue,
@bdombro
bdombro / zcatp
Last active August 29, 2015 14:01
#!/bin/bash
if [[ "$#" == 0 ]]; then
echo "
Version 1.0
Fancy zcat that shows progress.
Arg should be a gziped file ending in .gz
Syntax: bzcat <path_to_file_or_folder>
"
exit
#!/bin/bash
usage() {
echo "
Version 1.0
Fancy mysqldump for full DBs that shows progress.
Syntax: bmysqldump [-u <username>] [-p] [-h <hostname>] <database>
"
exit 0
}
#!/bin/bash
echo "
Installing Brian's custom server tools
Installer Version 1.4"
mkdir ~/bin &>1 /dev/null
echo "" >> ~/.bashrc
echo "PATH=\$PATH:~/bin" >> ~/.bashrc
@bdombro
bdombro / delete_en_mass.php
Last active August 29, 2015 14:01
Drush Delete Nodes in Mass Script
<?php
// ************ This script can be run from drush, like `drush scr <name of script>`
print "\n*************** Delete Nodes en mass V1.1 *******************";
print "\nThis program will delete nodes en mass.\nBe very careful when configuring to not accidently delete nodes.\n";
global $count1;
global $total;
$count1 = 0;
<?php
// Will parse queries and redirect appropriately
// Version 1.0
// Setup .htaccess to redirect certain links here
// Example: RedirectMatch /wiki* /legacy_file_redirect.php
if(isset($_GET["media"])) {
// handle http://dev.americanwhitewater.org/wiki/lib/exe/fetch.php?media=projects:gauley_project.jpg
# Base gitignore for drupal projects
# Version 1.0
htdocs/*
!htdocs/profiles
htdocs/profiles/*
!htdocs/profiles/aww
!htdocs/sites