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\custom_module\Controller; | |
use Drupal\Core\Controller\ControllerBase; | |
use Symfony\Component\DependencyInjection\ContainerInterface; | |
use Drupal\Core\Pager\PagerManagerInterface; | |
class ListNonDrupalItems extends ControllerBase { |
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
// https://www.geeksforgeeks.org/foldable-binary-trees/ | |
class BinaryTree { | |
static root = 1; | |
bt_array = []; | |
setRoot(data) { | |
this.bt_array[BinaryTree.root] = data; | |
} |
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
// Memcached Server URL and other settings. | |
$settings['memcache']['servers'] = ['localhost:11211' => 'default']; | |
$settings['memcache']['bins'] = ['default' => 'default']; | |
$settings['memcache']['key_prefix'] = 'pk'; | |
// Memcache cache backend related configs for all caches. | |
$settings['cache']['default'] = 'cache.backend.memcache'; | |
// Or some specific cache tables. | |
$settings['cache']['bins']['render'] = 'cache.backend.memcache'; | |
$settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.memcache'; |
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
vendor/bin/drush en -y admin_toolbar admin_toolbar_tools jsonapi |
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
composer require drupal/jsonapi | |
composer require drupal/admin_toolbar |
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
composer create-project drupal-composer/drupal-project:8.x-dev travel_destinations --stability dev --no-interaction |
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
ReactDOM.render(<App />, document.getElementById('root')); |
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
npx create-react-app react_app | |
cd react_app | |
npm 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
cors.config: | |
enabled: true | |
# Specify allowed headers, like 'x-allowed-header'. | |
allowedHeaders: ['*'] | |
# Specify allowed request methods, specify ['*'] to allow all possible ones. | |
allowedMethods: ['*'] | |
# Configure requests allowed from specific origins. | |
allowedOrigins: ['*'] | |
# Sets the Access-Control-Expose-Headers header. | |
exposedHeaders: true |
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
import React from 'react'; | |
export default class DestinationItem extends React.Component { | |
render() { | |
return ( | |
<div> | |
<h2>{this.props.attributes.title}</h2> | |
<div dangerouslySetInnerHTML={{__html: this.props.attributes.body.value}} /> | |
</div> |
NewerOlder