Skip to content

Instantly share code, notes, and snippets.

View andriyun's full-sized avatar
💭
drupaling

Andriyun andriyun

💭
drupaling
View GitHub Profile
@db-Matroskeen
db-Matroskeen / gist:69cf8c1881fc55a537588ca88ed20be3
Created March 10, 2022 12:41
Support Ukraine - message for drupal.org module pages.
<table class="views-view-grid" width="100%" bgcolor="#d4efcc">
<tr>
<td><h2>🇺🇦</h2></td>
<td>This module is maintained by Ukrainian developers.
Please consider <a href="https://supportukrainenow.org">supporting Ukraine</a> in a fight for their freedom and safety of Europe.</td>
</tr>
</table>
@DanLaufer
DanLaufer / Drupal 8 - Load entities with EntityTypeManager
Created October 19, 2018 16:17
Drupal 8 - Load entities with EntityTypeManager
// single
$service = \Drupal::service('entity_type.manager')->getStorage('node');
$node = $service->load(22);
// multiple
$entity = \Drupal::entityTypeManager()->getStorage($entity_type)->loadMultiple(array(22, 14, 8));
@pfaocle
pfaocle / gen-d8-salt.sh
Created March 8, 2016 09:39
Generate Drupal 8 hash salt
drush eval "var_dump(Drupal\Component\Utility\Crypt::randomBytesBase64(55))"