Skip to content

Instantly share code, notes, and snippets.

View MatthieuScarset's full-sized avatar
🤷‍♂️
Probably me

MattGyver MatthieuScarset

🤷‍♂️
Probably me
View GitHub Profile
{
"name": "drupal/drupal",
"description": "Drupal is an open source content management platform powering millions of websites and applications.",
"type": "project",
"license": "GPL-2.0+",
"require": {
"composer/installers": "^1.0.21",
"wikimedia/composer-merge-plugin": "~1.3",
"drupal/field_collection": "^8",
"drupal/panels":"^8",
@MatthieuScarset
MatthieuScarset / avatar.svg
Last active September 1, 2016 08:17
avatar.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
git reset --soft HEAD@{1}
\Drupal::entityManager()->getFieldDefinitions('entity_type_name', 'bundle_name');
@MatthieuScarset
MatthieuScarset / gist:98a62202c01806241f9c81cf9bb1e655
Last active November 20, 2016 17:36
Loop over paragrahs items
{% extends 'paragraph.html.twig' %}
{% block content %}
{{ attach_library('mytheme/slider') }}
{% for key, child in content if key|first != '#' %}
<div>{{ child }}</div>
{% endfor %}
{% endblock %}
@MatthieuScarset
MatthieuScarset / gist:113ed602c0061fb75316b20d883bd969
Created November 29, 2016 12:13
Remove gulp max file limit
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
@MatthieuScarset
MatthieuScarset / gist:d071a5b0d733e89fc9af1c6e31ea22e5
Created December 19, 2016 14:27
Drupal 8 - List all available services
$container = \Drupal::getContainer();
$container->getServiceIds();
@MatthieuScarset
MatthieuScarset / gist:47b57f2e3bd4afee39a81ae5a7c3dc28
Created December 27, 2016 14:14
Drupal 8 - Get canonical node URL in TWIG
{{ path('entity.node.canonical', {'node': node.id }) }}
@MatthieuScarset
MatthieuScarset / .bash_aliases
Last active March 20, 2017 08:12
My custom bash aliases
# Rexecute last cmd as root
alias fuck='sudo $(history -p \!\!)'
# Folders related aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# Typo (because I type quick and dirty...)
alias cc='clear'
$form_state->getFormObject()->getEntity();