Skip to content

Instantly share code, notes, and snippets.

View morsok's full-sized avatar

Alexandre Fauquez morsok

View GitHub Profile
@ricjcosme
ricjcosme / dump-restore
Created September 13, 2017 17:33
DUMP / RESTORE PostgreSQL Kubernetes
DUMP
// pod-name name of the postgres pod
// postgres-user database user that is able to access the database
// database-name name of the database
kubectl exec [pod-name] -- bash -c "pg_dump -U [postgres-user] [database-name]" > database.sql
RESTORE
// pod-name name of the postgres pod
// postgres-user database user that is able to access the database
// database-name name of the database
@DuaelFr
DuaelFr / MYMODULE.module
Created March 29, 2016 10:58
D8 menu item expanded by default
/**
* Implements hook_ENTITY_TYPE_presave().
*
* Force the expanded state on menu items in the main menu.
*/
function MYMODULE_menu_link_content_presave(MenuLinkContentInterface $entity) {
if ($entity->get('menu_name')->value == 'main') {
$entity->get('expanded')->set(0, TRUE);
}
}