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 | |
$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, |
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 | |
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 |
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 | |
usage() { | |
echo " | |
Version 1.0 | |
Fancy mysqldump for full DBs that shows progress. | |
Syntax: bmysqldump [-u <username>] [-p] [-h <hostname>] <database> | |
" | |
exit 0 | |
} |
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 | |
echo " | |
Installing Brian's custom server tools | |
Installer Version 1.4" | |
mkdir ~/bin &>1 /dev/null | |
echo "" >> ~/.bashrc | |
echo "PATH=\$PATH:~/bin" >> ~/.bashrc |
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 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; |
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 | |
// 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 |
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
# Base gitignore for drupal projects | |
# Version 1.0 | |
htdocs/* | |
!htdocs/profiles | |
htdocs/profiles/* | |
!htdocs/profiles/aww | |
!htdocs/sites |
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 duplicates all existing basic page primary aliases | |
// $nids = db_query("SELECT nid FROM node WHERE type = 'page' "); // not as good | |
$query = new EntityFieldQuery(); | |
$query->entityCondition('entity_type', 'node') | |
->entityCondition('bundle', 'page') | |
// ->propertyCondition('status', 1) | |
// ->fieldCondition('body', 'value', '%media/%', 'like') |
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 | |
function relation_get_related_entities($entity_type, $entity_id, $relation_type = NULL, $r_index = NULL) { | |
$query = relation_query($entity_type, $entity_id, $r_index); | |
if ($relation_type) { | |
$query->propertyCondition('relation_type', $relation_type); | |
} | |
$results = $query->execute(); | |
$relations = array(); |
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
<div id="vmap" style="height: 400px;"> </div> | |
<script> | |
var state_to_term_code = { | |
'CA': 183, | |
'HI': 184, | |
'DC': 186, | |
'DE': 187, | |
'MD': 188, | |
'NJ': 189, | |
'PA': 190, |
OlderNewer