- rss.xml - single purpose path responding with a content type
- node/1.json - multipurpose path with an extension denoting content type.
- myalias.json - an alias with and extension.
- admin/foo/example.plugin_id - An arbitrary path containing some placeholder
- rest/node/1 - a non-web endpoint doing full conneg
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
[ | |
{ | |
"typeID":35, | |
"regionID":10000011, | |
"orders":[ | |
{ | |
"volRemaining":95050881, | |
"volEntered":100000000, | |
"range":32767, | |
"price":3.03, |
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 | |
namespace Drupal\Component\Utility; | |
/** | |
* Builds an array of strings for printing. | |
*/ | |
class StringBuilder { | |
use ToStringTrait; |
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
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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
/** | |
* Implements hook_views_data_alter(). | |
*/ | |
function feature_user_views_data_alter(&$data) { | |
// Actions | |
$data['users']['profession'] = array( | |
'title' => t('Profession'), | |
'help' => t('Profession of a user'), | |
'field' => 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
$times = array(); | |
for ($i = 0; $i <= 10; $i++) { | |
$view = views_get_view('frontpage'); | |
for ($j = 0; $j <= 100; $j++) { | |
$view->setDisplay('page_1'); | |
$view->execute(); | |
$start = microtime(); | |
$view->destroy(); |
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 asin_field_views_data($field) { | |
$data = field_views_field_default_views_data($field); | |
foreach ($data as $table_name => $table_data) { | |
foreach ($table_data as $field_name => $field_data) { | |
// Check for fieldapi value fields. | |
if (isset($field_data['filter']['field_name'])) { | |
$data[$table_name][$field_name]['relationship'] = array( | |
'handler' => 'views_handler_relationship', | |
'base' => 'amazon_item', |
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 | |
//$Id$ | |
class content_moderation_handler_filter_pending_revision extends views_handler_filter { | |
function construct() { | |
parent::construct(); | |
$this->additional_fields['node_vid'] = array('table' => 'node', 'field' => 'vid'); | |
$this->additional_fields['revision_vid'] = array('table' => 'node_revision', 'field' => 'vid'); | |
} |