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 | |
// Preprocess | |
function minim_preprocess_views_view_table(&$variables) { | |
if (!empty($variables['header'])) { | |
$variables['headers_rendered'] = ''; | |
foreach ($variables['header'] as $field => $label) { | |
$variables['headers_rendered'] .= "<th class='" . $variables['header_classes'][$field] . "'>" . $label . "</th>"; | |
} | |
} | |
if (!empty($variables['rows'])) { |
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 | |
// Get All Airings BY Project Per Range | |
$start = 1383845472; | |
$end = 1384450272; | |
$query = db_select('field_data_field_om_airing_dates', 'dates'); | |
$query->join('field_data_field_om_show_id', 'om_show', 'dates.entity_id=om_show.entity_id'); | |
$query->join('field_data_field_om_show_project', 'project', 'om_show.field_om_show_id_value=project.entity_id'); | |
$query->fields('project', array('field_om_show_project_nid')); | |
$query->addExpression('COUNT(field_om_show_project_nid)', 'airings'); | |
$query->condition('dates.field_om_airing_dates_value', $start, '>='); |
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
$start = 1383845472; | |
$end = 1384450272; | |
$query = db_select('field_data_field_om_airing_dates', 'dates'); | |
$query->join('field_data_field_om_show_id', 'om_show', 'dates.entity_id=om_show.entity_id'); | |
$query->join('field_data_field_om_show_project', 'project', 'om_show.field_om_show_id_value=project.entity_id'); | |
$query->fields('project', array('field_om_show_project_nid')); | |
$query->fields('om_show', array('field_om_show_id_value')); | |
$query->fields('dates', array('field_om_airing_dates_value', 'field_om_airing_dates_value2')); | |
$query->condition('dates.field_om_airing_dates_value', $start, '>='); | |
$query->condition('dates.field_om_airing_dates_value2', $end, '<='); |
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
(function($) { | |
/** | |
* Jquery function to attach/detach click stopping. | |
* Call on link or input: $('selector').clickStopper({message: 'Optional message'}); | |
* Destroy by calling again. | |
*/ | |
$.fn.clickStopper = function(options) { | |
// return this to maintain chainability | |
return this.each(function() { | |
if ($(this).hasClass('click-stopper-processed')) { |
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
(function($) { | |
$.fn.placeholder = function(message) { | |
return this.each( | |
function() { | |
if ($(this).hasClass('form-placeholder-processed')) { | |
detach($(this)); | |
} | |
else { | |
$(this).addClass('form-placeholder-processed'); | |
$(this).data('form-placeholder', message); |
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 data_engine_node_view($node, $view_mode, $langcode) { | |
if ($node->type == 'indicator') { | |
$indicator_values = data_engine_indicator_values($node); | |
$dmetro_codes = data_engine_metro_denver_org_codes(); | |
$dmetro_values = array(); | |
foreach($indicator_values as $key => $info) { | |
if (array_key_exists($info->district_number, $dmetro_codes)) { | |
$dmetro_values[] = array( | |
'organization_name' => $dmetro_codes[$info->district_number], |
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 csi_api_indicator_get_data($nid) { | |
$values = array(); | |
$all_data = &drupal_static(__FUNCTION__); | |
if (empty($all_data)) { | |
$all_data = array(); | |
} | |
if (!empty($all_data[$nid])) { | |
return $all_data[$nid]; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<script src="./conway.js" ></script> | |
</head> | |
<body></body> | |
</html> | |
// conway.js |
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 | |
class omfGoogleDistanceMatrix { | |
protected $origins = array(); | |
protected $destinations = array(); | |
protected $unit = 'imperial'; | |
protected $mode = 'driving'; | |
protected $language = 'en'; | |
protected $api_key = ''; | |
protected $endpoint = 'https://maps.googleapis.com/maps/api/distancematrix/json'; |
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
// Inputs in Radians so degtorad degrees first. | |
function vincenty($lat1, $lon1, $lat2, $lon2) { | |
// Equitorial Radius | |
$a = 6378137.0; | |
// Polar Radius | |
$b = 6356752.31424518; | |
//Flattening of the ellipsoid | |
$f = 0.00335281066; | |
// Difference in longitude | |
$L = $lon2 - $lon1; |
OlderNewer