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
const respondToAskAboutLunch = require('./lunch-handler'); | |
module.exports = { | |
AskAboutLunchIntent: respondToAskAboutLunch, | |
LaunchRequest: respondToLaunch, | |
'AMAZON.HelpIntent': respondToHelp, | |
'AMAZON.StopIntent': respondToCancel, | |
'AMAZON.CancelIntent': respondToCancel, | |
}; |
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
const languageStrings = require('./languageStrings'); | |
const getSession = require('./util').getSession; // getSession(handlerInput) | |
const setSession = require('./util').setSession; // setSession(handerInput, attributes) | |
const buildResponse = require('./util').buildResponse; // buildResponse(handlerInput, speakText, repromptText = null) | |
const buildFinalResponse = require('./util').buildFinalResponse; // buildFinalResponse(handlerInput, speakText) | |
const checkIntentType = require('./util').checkIntentType; | |
const checkIntentName = require('./util').checkIntentName; | |
const CancelAndStopIntentHandler = { | |
canHandle : function(handlerInput) { |
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 | |
/** | |
* Implements hook_install(). | |
*/ | |
function gamecontenttype_install() { | |
node_types_rebuild(); | |
$types = node_type_get_types(); | |
foreach(_gamecontenttype_fields() as $field) { | |
field_create_field($field); | |
} |
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
//Join node table with a field table and search for published nodes of a certain type with a specific field value: | |
SELECT node.nid AS node_id, | |
LEFT(node.title, 10) AS node_title, field_data_field_reference_database_id.field_reference_database_id_value as ref_id | |
FROM node | |
LEFT JOIN field_data_field_reference_database_id | |
ON node.nid = field_data_field_reference_database_id.entity_id | |
WHERE type='location' | |
AND status='1' | |
AND field_data_field_reference_database_id.field_reference_database_id_value IS NULL; |
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
$config['configuration.prefix']['myVariable'] = 'Value'; |
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
#!/usr/bin/env bash | |
# drushpap - drush paragraph-add-permission | |
# usage: ./scripts/drushpap <paragraph_machine_name> | |
# to view the list of current permissions and roles, type: lando drush role:list | |
if [ "$1" = "" ]; then | |
echo "Error: incorrect number of arguments." | |
echo " - The drushpap command takes 1 argument: the machine name of the paragraph. It then gives permission to authenticated users for create, delete, update, and view, and for anonymous users to view only." |
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
#!/usr/bin/env bash | |
# drushnap - drush node-add-permissions | |
# usage: ./scripts/drushnap <role_machine_name> <node_machine_name> | |
# to view the list of current permissions and roles, type: lando drush role:list | |
if [ "$1" = "" ] || [ "$2" == "" ]; then | |
echo "Error: incorrect number of arguments." | |
echo " - The drushnap command takes 2 arguments: the machine name of the role and the machine name of the node. It then gives permission to that role for create, delete any, delete own, edit any, edit own, delete revisions, revert revisions, view revisions, and translate for that node." |
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
/** | |
* @file | |
* Install, update and uninstall functions for the sports_system module. | |
*/ | |
/** | |
* Implements hook_uninstall(). | |
*/ | |
function sports_system_uninstall() { | |
$storage = \Drupal::entityManager()->getStorage('node'); |
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
// load file from id | |
$file_entity = \Drupal::entityTypeManager()->getStorage('file')->load($target_id); | |
//Get Uri/Url of file | |
//in preprocess field | |
$svg_uri = $vars['items']['0']['content']['#file']->getFileUri(); | |
//in preprocess node | |
$svg_uri = $node->field_svg_image->entity->get('uri')->getValue(); |
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
$user_entity = $node->uid->entity; | |
$variables['author_name'] = $user_entity->get('field_display_name')->view(); | |
$user_picture = $user_entity->get('user_picture')->getValue(); | |
if (_user_has_picture($user_picture)) { | |
$target_id = $user_picture[0]['target_id']; | |
$variables['author_picture_uri'] = _get_user_picture_uri($target_id); | |
} | |
$variables['author_bio'] = $user_entity->get('field_bio')->view(); | |
$variables['author_twitter'] = $user_entity->get('field_twitter_username')->value; | |
$variables['author_url'] = $user_entity->urlInfo()->toString(); |