Skip to content

Instantly share code, notes, and snippets.

View keopx's full-sized avatar

Ruben Egiguren keopx

View GitHub Profile
@keopx
keopx / Headphone
Created March 24, 2017 09:15
Headphone
https://pricklytech.wordpress.com/2012/05/26/ubuntu-12-04-dell-vostro-3750-no-sound-when-headphones-are-plugged-in/
@keopx
keopx / Group
Created January 24, 2017 18:49
Group
https://www.drupal.org/project/issues/group?text=view&version=8.x
@keopx
keopx / Group_the_user_registerd.md
Last active January 24, 2017 18:22
Drupal 8 Group - Create a view : Contents of groups the user is registered

Drupal 8 Group - Create a view : Contents of groups the user is registered

I've had a similar problem where I needed to show groups in which the current user is a member of and nodes that reference those groups (2 views). I started off from the wrong side but then I changed the view and started off from Group Content. So try like this:

  • Create a new view and set the content of the view to be Group content
  • Add a relationship to Group (The group containing the entity.) so you will get the Group title etc
  • Add a relationship to Group content for User (Relates to the group content entities that represent the User.) so you will get the Groups of the current user
  • Add a contextual filter User ID and when the filter value is not available set the default value to User ID from logged in user and the relationship should be the Group content for User

Now you can add a field Title and set the relationship on the Group and you should get a list of groups the user is a member of. After that, it's just a matter o

@keopx
keopx / template.tpl.php
Created November 23, 2016 09:23 — forked from gagarine/template.tpl.php
Working with drupal theme_menu_tree
<?php
/**
* Theme_menu_tree doesn't provide any context information
* THIS SUCKS
* But you can use hook_block_view_alter to change the theme wrapper
* OUF!
*/
function MYTHEME_menu_tree(&$variables) {
@keopx
keopx / resources.md
Created November 13, 2016 10:18 — forked from skwashd/resources.md
DrupalCon Dublin: Let the Machines do the Work
@keopx
keopx / README.md
Created November 13, 2016 10:17 — forked from skwashd/README.md
Drupal git pre-commit hook

This pre-commit hook is designed to be used for Drupal 7 and 8 sites.

Download the pre-commit file. Save it as .git/hook/pre-commit in your git repo. You need to ensure that the file is executable.

If you want this to be added to all new projects automatically, add it to your git init templates.

To install and PHP CodeSniffer for Drupal, please read the official documentation.

To see this working checking out this short YouTube video.

@keopx
keopx / update_drupalconsole
Created November 5, 2016 09:00
Update drupalconsole
Updating dependencies (including require-dev)
- Removing drupal/console-en (1.0.0-rc5)
- Installing drupal/console-en (1.0.0-rc7)
Downloading: 100%
- Removing drupal/console-core (1.0.0-rc7)
- Installing drupal/console-core (v1.0.0-rc8)
Downloading: 100%
- Removing drupal/console (1.0.0-rc7)
@keopx
keopx / docker-compose_clean_bronken_images.sh
Created October 3, 2016 06:42
Docker Compose clean bronken images
docker-compose rm -f
docker-compose pull
docker-compose up --build -d
@keopx
keopx / Clean_broken_containter.sh
Created May 30, 2016 15:12
Clean broken docker containter
docker images|grep \<none\>|awk '{print $3}' | xargs docker rmi -f
@keopx
keopx / .bashrc
Created April 28, 2016 07:08
Docker stop all containers
# Stop all docker container
function docker-stop-all() {
docker stop $(docker ps -a -q)
}