Skip to content

Instantly share code, notes, and snippets.

View achraf-jeday's full-sized avatar
🏠
Working from home

Achraf Jeday achraf-jeday

🏠
Working from home
View GitHub Profile
@achraf-jeday
achraf-jeday / Docker most used commands and drush for drupal 8
Last active June 21, 2022 14:07
Docker and drush most used commands (drupal 8)
List all containers (only IDs):
docker ps -aq
Stop all running containers:
docker stop $(docker ps -aq)
Or this one:
docker-compose down --remove-orphans
Or this one:
@achraf-jeday
achraf-jeday / load_node_translations.php
Last active May 11, 2021 12:56
Drupal 8: How to load available translations of a given node, change some fields and save.
<?php
// Credit to Gábor Hojtsy
// http://hojtsy.hu/blog/2015-nov-11/drupal-8-multilingual-tidbits-19-content-translation-development
use Drupal\node\Entity\Node;
// Load node 4. In terms of language, this will get us an entity
// in the original submission language.
$node = Node::load(4);
@achraf-jeday
achraf-jeday / chosen-bootstrap.css
Created January 9, 2018 17:06 — forked from koenpunt/chosen-bootstrap.css
Bootstrap 3.0 theme for Chosen
select.form-control + .chosen-container.chosen-container-single .chosen-single {
display: block;
width: 100%;
height: 34px;
padding: 6px 12px;
font-size: 14px;
line-height: 1.428571429;
color: #555;
vertical-align: middle;
background-color: #fff;
@achraf-jeday
achraf-jeday / gist:7a9084ee248c51e834e043bf1c320868
Created October 11, 2017 10:26 — forked from paulallies/gist:0052fab554b14bbfa3ef
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
@achraf-jeday
achraf-jeday / gist:3dce48d6462949f38d8f7207b08b050d
Created August 21, 2017 11:06 — forked from imcmahon/gist:4335d05967f54bb6d14e
jQuery remove all classes with the same prefix
$('html').removeClass(function (index, css) {
return (css.match (/\bpage-\S+/g) || []).join(' '); // removes anything that starts with "page-"
});
@achraf-jeday
achraf-jeday / drupal8-links.php
Created August 1, 2017 09:06 — forked from colorfield/drupal8-links.php
Drupal 8 links, or where is my l() function