Skip to content

Instantly share code, notes, and snippets.

View sharique's full-sized avatar
🏢

Sharique Ahmed Farooqui sharique

🏢
View GitHub Profile
@crittermike
crittermike / import.php
Last active June 6, 2025 11:21
Importing Drupal 8 config programmatically
<?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');
@gwagroves
gwagroves / module.php
Last active October 9, 2024 18:14
Drupal 8 Paragraphs: Add a theme suggestion based on the paragraph and the type of the parent node / entity.
<?php
/**
* Implements theme_suggestions_HOOK_alter().
*/
function mytheme_theme_suggestions_paragraph_alter(array &$suggestions, array $variables) {
/** @var \Drupal\paragraphs\ParagraphInterface $paragraph */
$paragraph = $variables['elements']['#paragraph'];
/** @var \Drupal\Core\Entity\ContentEntityInterface $parent */
$parent = $paragraph->getParentEntity();
@teclator
teclator / INSTALLATION_WORKFLOW.md
Last active May 20, 2016 13:08
Installation Workflow (Networking) discussion

Description

The goal of this document is to discuss or show how affect the network configuration to the installation workflow, and in particular how installation self-update is affected and how it could be improved.

Network Availability: Having at least one interface configured with an IP address.

Self update scenarios

In the last Sprint we added self-update to yast-installation, so now if network is available we will check for updates and in case there are some update for our system, it will automatically downloaded and installed.

@jibran
jibran / .eslintrc
Last active July 19, 2017 12:14
Sample eslint file for Drupal 7
{
"env": {
"browser": true
},
"globals": {
"Drupal": true,
"jQuery": true,
"tinyMCE": true
},
"rules": {