use Drupal\field\Entity\FieldStorageConfig;
use Drupal\field\Entity\FieldConfig;
$bundles = ['user'];
$fields['user_picture'] = [
'type' => 'image',
'entity_type' => 'user',
'bundle' => 'user',
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
[ | |
{ | |
"thoughts": { | |
"text": "Starting a discord server for the AkiraAI community named AkiraAI,", | |
"reasoning": "Creating a space for the community to engage and interact, promote growth and learning", | |
"plan": "- Create a Discord account \n- Create the AkiraAI server \n- Set up server categories and channels \n- Invite members to join server", | |
"criticism": "None" | |
}, | |
"command": { | |
"name": "message_agent", |
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
To embed a React component inside a Drupal 8 page template, you first need to create a React component and bundle it into a JavaScript file. Then, you can include the JavaScript file in your Drupal theme or module and use it in your page template. | |
Here’s an example of how to embed a React component inside a Drupal 8 page template: | |
1. Create a new React component called MyComponent in a JavaScript file, e.g. mycomponent.jsx: | |
import React from 'react'; | |
class MyComponent extends React.Component { | |
render() { |
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 | |
/** | |
* @file mymodule.module | |
* Includes drupal hooks for module. | |
*/ | |
use Drupal\mymodule\PremiumContentAccessControlHandler; | |
/** | |
* Implements hook_entity_type_alter(). | |
*/ | |
function mymodule_entity_type_alter(array &$entity_types) { |
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
// Available on the Unity Asset Store https://www.assetstore.unity.com/publishers/49504 | |
// Copyright © 2020 Shamil Bikmullin | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class CityGenerator : MonoBehaviour | |
{ |
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
PROJECT: DELTA UI | |
BY: Oo | |
COMPANY: io | |
V: 1.1 | |
LIC: FREE if you leave in the credit | |
$: Any IN-GAME donations are welcome | |
--------------------------------------------------------------------------- | |
#### HOW TO INSTALL |
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
{ | |
"require": { | |
"react/event-loop": "^1.1", | |
"react/stream": "^1.1", | |
"react/promise": "^2.8", | |
"react/socket": "^1.6", | |
"react/http": "^1.2", | |
"nubs/random-name-generator": "^2.2" | |
} | |
} |
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 | |
// Import arbitrary config from a variable. | |
// Assumes $data has the data you want to import for this config. | |
$config = \Drupal::service('config.factory')->getEditable('filter.format.basic_html'); | |
$config->setData($data)->save(); | |
// Or, re-import the default config for a module or profile, etc. | |
\Drupal::service('config.installer')->installDefaultConfig('module', 'my_custom_module'); |
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
/** | |
* {@inheritdoc} | |
*/ | |
public function getCacheMaxAge() { | |
// Cache this for 1 minute. | |
return 60; | |
} |
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
/** | |
* Sets expires and max-age for bubbled-up max-age values that are > 0. | |
* | |
* @param \Symfony\Component\HttpKernel\Event\FilterResponseEvent $event | |
* The response event. | |
* | |
* @throws \Exception | |
* Thrown when \DateTime() cannot create a new date object from the | |
* arguments passed in. | |
*/ |
NewerOlder