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
public function handleAutocomplete(Request $request, $target_type, $selection_handler, $selection_settings_key) {
$matches = array();
// Get the typed string from the URL, if it exists.
if ($input = $request->query->get('q')) {
$typed_string = Tags::explode($input);
$typed_string = Unicode::strtolower(array_pop($typed_string));
// Selection settings are passed in as a hashed key of a serialized array
// stored in the key/value store.
$selection_settings = $this->keyValue->get($selection_settings_key, FALSE);
#
# This Replaces the old Drupal 7's module .info
#
name: Todo: Make Drupal 8 Fun
type: module # Either module or theme
description: Creates our custom TODO module
core: 8.x
package: TODO
configure: entity.todo.settings # This replaces the old admin path from Drupal 7
tags: # Tags can be used as a categorization method for your modules.
@cmcintosh
cmcintosh / gist:e695370870dba552e21b
Created December 15, 2015 08:49
Hook_gateway_info
/**
* Implement hook_gateway_info
*/
function sms_fowiz_gateway_info() {
return array(
'sms_fowiz' => array(
'name' => 'FOWiz Gateway',
'send' => 'sms_fowiz_send',
'recieve' => TRUE,
'configure form' => 'sms_fowiz_settings',
<?php
try {
error_reporting(E_ALL);
ini_set('display_errors', '1');
// Load Up Magento Core
define('MAGENTO', realpath('/path/to/magento'));
require_once(MAGENTO . '/app/Mage.php');
$view = new view();
$view->name = 'testing';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'search_api_index_author_expert_index';
$view->human_name = 'testing';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
{
"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":""
/**
* This is search be afeared!
*/
function urbaninstitute_search_menu() {
$item['counter'] = array( );
}
function urbaninstitute_search_menu_counter_callback() {
/**
* 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;
}