Skip to content

Instantly share code, notes, and snippets.

View cmcintosh's full-sized avatar
💭
Looking For Projects

Chris McIntosh cmcintosh

💭
Looking For Projects
View GitHub Profile
@cmcintosh
cmcintosh / pre-commit
Last active August 29, 2015 14:07 — forked from jpoesen/pre-commit
#!/usr/bin/php
<?php
/**
* @file
* A Git pre-commit hook script to check files for PHP syntax errors and Drupal
* coding standards violations. Requires phpcs and Coder Sniffer:
*
* @see https://drupal.org/node/1419988
* Hat tip: dcq.module (DrupalCodeQuality)
<?php
function your_theme_js_alter(&$javascript) {
global $base_url;
$jQuery_version = '1.11.0';
// Local Cached copy > $jQuery_local = $base_url.'/'.drupal_get_path('module', 'my_module').'/jquery-'. $jQuery_version .'.min.js';
$jQuery_cdn = 'http://code.jquery.com/jquery-' . $jQuery_version . '.min.js';
$javascript['misc/jquery.js']['data'] = $jQuery_cdn;
$javascript['misc/jquery.js']['version'] = $jQuery_version;
<?php
/**
* @file
* Definition of Drupal\comment\CommentForm.
*/
namespace Drupal\comment_timer;
use Drupal\comment;
<?php
/**
* @file
* Contains \Drupal\Core\Field\Plugin\Field\FieldWidget\NumberWidget.
*/
namespace Drupal\Core\Field\Plugin\Field\FieldWidget;
use Drupal\Core\Field\FieldItemListInterface;
@cmcintosh
cmcintosh / gist:e16835459a317b7791b7
Last active August 29, 2015 14:14
src/Plugin/Field/FieldWidget/CommentTimerWidget.php
<?php
/**
* @file
* Contains \Drupal\comment_timer\Plugin\Field\FieldWidget\NumberWidget.
*/
namespace Drupal\comment_timer\Plugin\Field\FieldWidget;
use Drupal\Core\Field\FieldItemListInterface;
<div id="content-container">
<div class="main-content">
<!-- left, right, main columns -->
</div>
<div id="breadcrumbs">
....
</div>
/**
* Overrides parent::render_grouping().
*/
function render_grouping($records, $groupings = array(), $group_rendered = NULL) {
$sets = parent::render_grouping($records, $groupings, $group_rendered);
// Apply the offset and limit.
array_walk($sets, array($this, 'group_limit_recursive'));
return $sets;
}
/**
* This is search be afeared!
*/
function urbaninstitute_search_menu() {
$item['counter'] = array( );
}
function urbaninstitute_search_menu_counter_callback() {
{
"nodes":[
{
"node":{
"title":"",
"body_summary":"",
"type":"",
"field_research_area":"",
"field_author_field_fullname":"",
"field_author":""
{
"nodes":[
{
"node":{
"title":"",
"body_summary":"",
"type":"",
"field_research_area":"",
"field_author_field_fullname":"",
"field_author":"",