Skip to content

Instantly share code, notes, and snippets.

View liberatr's full-sized avatar

Ryan Price liberatr

View GitHub Profile
@liberatr
liberatr / my_module.module
Last active September 23, 2022 22:24 — forked from reinis-kinkeris/my_module.module
Drupal 8 - Example of adding dynamic js libraries which require locale
/**
* Implements hook_library_info_build().
*
* @return array
*/
function mymodule_library_info_build() {
$libraries = [];
$api_key = \Drupal::config('mymodule.api_key');
@liberatr
liberatr / setlangcode.drush.inc
Last active September 22, 2017 17:08 — forked from lipcpro/setlangcode.drush.inc
D7: drush command to list content types available and set the language code for a certain type
<?php
/**
* Implements hook_drush_command().
*/
function setlangcode_drush_command() {
$items = array();
// The 'setlangcode' command.
$items['setlangcode'] = array(
'description' => "Sets the language code for certain types of entities.",