This file contains hidden or 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
/** | |
* Decodes url encoded strings | |
* | |
* @param: string - url or email address we want to decode | |
*/ | |
function urldecode(url) { | |
return decodeURIComponent(url.replace(/\+/g, ' ')); | |
} |
This file contains hidden or 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 | |
#script to clean up after new Drupal import from prod | |
#execute from a directory inside your Drupal docroot | |
drush dis cdn --yes | |
drush en views_ui --yes | |
drush en devel --yes | |
drush en context_ui --yes | |
drush en stage_file_proxy --yes | |
drush vset preprocess_css 0 --yes |
This file contains hidden or 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
function food52_parse_question_array($payload, $header) { | |
$results = drupal_json_decode($payload); // api returns double-encoded json | |
$out = '<h2>' . $header . '</h2>'; | |
// We then iterate through the array to build questions | |
foreach ($results as $i) { | |
$question = drupal_json_decode($i); | |
// Title | |
$linkurl = $_SERVER['SERVER_NAME'] . '/hotline/'; | |
$linkoptions = array( | |
'attributes' => array( |
This file contains hidden or 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
$args = $view->args[0]; | |
$exploded = explode('+',$args); | |
$flipped = array_flip($exploded); | |
if($flipped[$row1->nid] < $flipped[$row2->nid]) { | |
return 0; | |
} else { | |
return 1; | |
} |
This file contains hidden or 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 | |
$db['hostname']='localhost'; | |
$db['username']='root'; | |
$db['password']='root'; | |
$db['schema']='wkf_salad_map'; | |
date_default_timezone_set('America/Chicago'); | |
$path = 'wkfimages/'; | |
if(!$link = mysqli_connect($db['hostname'], $db['username'], $db['password'])){ | |
echo mysqli_errno($link) . ": " . mysqli_error($link) . "\n"; |
This file contains hidden or 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 | |
$db['hostname']='localhost'; | |
$db['username']='root'; | |
$db['password']='root'; | |
$db['schema']='old_wkf'; | |
if(!$link = mysqli_connect($db['hostname'], $db['username'], $db['password'])){ | |
echo mysqli_errno($link) . ": " . mysqli_error($link) . "\n"; | |
} | |
if(!mysqli_select_db($link, $db['schema'])){ |
This file contains hidden or 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
function getExtension($filename){ | |
if($array = explode('.', $filename)){ | |
$last = count($array) -1; | |
$ext = strtolower($array[$last]); | |
return $ext; | |
} else { | |
return FALSE; | |
} | |
} |
This file contains hidden or 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
if($result = mysqli_query($link, $sql)){ | |
while($row = mysqli_fetch_array($result)) { | |
//Do Stuff | |
} | |
} else { | |
echo mysqli_errno($link) . ": " . mysqli_error($link) . "\n"; | |
} |
NewerOlder